Re: [Zope] questions about migrating forwards

2010-03-11 Thread Jeff Peterson
I have used LocalFS, but at the time I upgraded it had to be patched too, you 
could check around and see if it's been updated.  I believe it's still actively 
maintained.
--
Jeffrey D Peterson
Webmaster
Crary Industries, Inc.

From: zope-boun...@zope.org [mailto:zope-boun...@zope.org] On Behalf Of Andrew 
Watkins
Sent: Thursday, March 11, 2010 2:15 PM
To: Tres Seaver; zope@zope.org
Subject: Re: [Zope] questions about migrating forwards


Thanks for the useful responses

Is there some other Product that people use to bring external files into the 
zope environment?


Andrew


Andrew Watkins
Systems Development Team Manager
National Institute Water & Atmospheric Research (NIWA).


>>> On 12 Mar 10 at 04:05 AM, in message , Tres 
>>> Seaver  wrote:

You will eed to patch ExternalFile to use Zope3-style interfaces.  E.g.,
instead of:

  from Interface import Interface

patch it to be:

  from zope.interface import Interface

Their may be other changes required, as well, depending on how the
product uses the interfaces.  (Later:  I've done the patch, at least to
the extent of getting the appserver to start:  see attachment).

> 2. ZMySQLDA This fails with the message 'ImportError: No module named
> _mysql' again this works ok on zope 2.11.4

You need to install the MySQL-python package into your virtuaenv:

  $ bin/easy_install MySQL-python


NIWA is the trading name of the National Institute of Water & Atmospheric 
Research Ltd.
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] questions about migrating forwards

2010-03-11 Thread Andrew Watkins

Thanks for the useful responses
 
Is there some other Product that people use to bring external files into the 
zope environment? 

Andrew 


Andrew Watkins
Systems Development Team Manager
National Institute Water & Atmospheric Research (NIWA).


>>> On 12 Mar 10 at 04:05 AM, in message , Tres 
>>> Seaver  wrote:



You will eed to patch ExternalFile to use Zope3-style interfaces.  E.g.,
instead of:

  from Interface import Interface

patch it to be:

  from zope.interface import Interface

Their may be other changes required, as well, depending on how the
product uses the interfaces.  (Later:  I've done the patch, at least to
the extent of getting the appserver to start:  see attachment).

> 2. ZMySQLDA This fails with the message 'ImportError: No module named
> _mysql' again this works ok on zope 2.11.4

You need to install the MySQL-python package into your virtuaenv:

  $ bin/easy_install MySQL-python

NIWA is the trading name of the National Institute of Water & Atmospheric 
Research Ltd.
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] questions about migrating forwards

2010-03-11 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew Watkins wrote:

> We have a legacy web service that is running on Zope 2.6.2 with
> Python 2.3.3
> 
> For various reasons - security, maintenance etc we have decide to try
> migrating this forward to a current version of python and zope. e.g.
> Python 2.6 + Zope 2.12.2
> 
> I have a new clean SUSE linux 11 installation with the correct
> python, setuptools and I am using virtualenv to create a sandbox
> 
> I have installed the zope 2.12.2 and configured it in much the same
> way as the older system - (zeo with two data files, + 1 zope
> instance.)
> 
> All is good and I can start up the instance and access the management
> pages.
> 
> My next step is to get the Products list that we were using running.
> Here I have run into two problems 1. ExternalFile This fails to load
> with the error 'ImportError: No module named Interface'  (stack trace
> below) I tested this with zope 2.11.4 and it works ok.

You will eed to patch ExternalFile to use Zope3-style interfaces.  E.g.,
instead of:

  from Interface import Interface

patch it to be:

  from zope.interface import Interface

Their may be other changes required, as well, depending on how the
product uses the interfaces.  (Later:  I've done the patch, at least to
the extent of getting the appserver to start:  see attachment).

> 2. ZMySQLDA This fails with the message 'ImportError: No module named
> _mysql' again this works ok on zope 2.11.4

You need to install the MySQL-python package into your virtuaenv:

  $ bin/easy_install MySQL-python

> So I guess there is a key step that I am missing out or a path, or
> installation that is required. The main difference is that 2.12 is
> installed using virtualenv and then easy_install
> 
> e.g. bin/easy_install -i http://download.zope.org/Zope2/index/2.12.2
> Zope2
> 
> Are there known incompatabilities with these Products ?  or is my
> installation just not quite right.

The ExternalFile product is quite old, and could likely use a maintainer
to keep it up to date.  I haven't seen Craeg Strong (the author) around
in Zopeland for quite some time:  he might be happy to hand it over to
you as a person who still needs to have the product work.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkuZBqMACgkQ+gerLs4ltQ7iEwCdEd6cK5kdQeca99TcNcyRxliG
mFsAoMrhzX4LaHA6tram/qp231jaUZ1l
=Tla2
-END PGP SIGNATURE-
=== modified file 'ExternalFile.py'
--- ExternalFile.py	2010-03-11 14:26:01 +
+++ ExternalFile.py	2010-03-11 14:28:28 +
@@ -33,6 +33,7 @@
# traversal, acquisition, and persistence
 from Products.ZCatalog.CatalogAwareness import CatalogAware # Reqd for ZCatalog support
 from OFS.PropertyManager import PropertyManager  # Reqd for proper property mgmt
+from zope.interface import implements
 from IExternalFile import IExternalFile
 
 # Local modules
@@ -117,7 +118,7 @@
 meta_type = 'External File' # This is the name Zope will use for
 # the Product in the "addProduct" list
 
-__implements__ = IExternalFile
+implements(IExternalFile)
 
 behave_like_list= [ 'DTMLDocument', 'DTMLMethod', 'File', 'Image', 'PageTemplate'  ]
 

=== modified file 'IExternalFile.py'
--- IExternalFile.py	2010-03-11 14:26:01 +
+++ IExternalFile.py	2010-03-11 14:27:56 +
@@ -13,13 +13,13 @@
 __version__ = '$Revision: 1.7 $'[10:-2]
 
 # Zope Base Classes
-from Interface import Base
+from zope.interface import Interface
 
 
 # IExternalFile interface
 
 
-class IExternalFile(Base):
+class IExternalFile(Interface):
 """
 Encapsulates a file in the filesystem as a Zope object.
 """

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] questions about migrating forwards

2010-03-11 Thread Jeff Peterson


--
Jeffrey D Peterson
Webmaster
Crary Industries, Inc.

From: zope-boun...@zope.org [mailto:zope-boun...@zope.org] On Behalf Of Andrew 
Watkins
Sent: Wednesday, March 10, 2010 9:35 PM
To: zope@zope.org
Subject: [Zope] questions about migrating forwards


Hi list

We have a legacy web service that is running on Zope 2.6.2 with Python 2.3.3


For various reasons - security, maintenance etc we have decide to try migrating 
this forward to a current version of python and zope.

e.g. Python 2.6 + Zope 2.12.2


I have a new clean SUSE linux 11 installation with the correct python, 
setuptools and I am using virtualenv to create a sandbox


I have installed the zope 2.12.2 and configured it in much the same way as the 
older system - (zeo with two data files, + 1 zope instance.)


All is good and I can start up the instance and access the management pages.


My next step is to get the Products list that we were using running.  Here I 
have run into two problems

1. ExternalFile

This fails to load with the error 'ImportError: No module named Interface'  
(stack trace below)

I tested this with zope 2.11.4 and it works ok.



Either port ExternalFile over to using zope.interface or find a new product to 
do what ExternalFile was doing for you.


2. ZMySQLDA

This fails with the message 'ImportError: No module named _mysql'

again this works ok on zope 2.11.4


So I guess there is a key step that I am missing out or a path, or installation 
that is required.

The main difference is that 2.12 is installed using virtualenv and then 
easy_install



You need to install mysql-python into virtualenv, activate your environment and 
use easy-install to install mysql-python from there.


e.g. bin/easy_install -i http://download.zope.org/Zope2/index/2.12.2 Zope2


Are there known incompatabilities with these Products ?  or is my installation 
just not quite right.


Thanks Andrew



stack trace for loading ExternalFile

{code}

/web/science_1/bin # ./zopectl fg

/web/science_1/bin/runzope -X debug-mode=on

2010-03-11 14:28:22 INFO ZServer HTTP server started at Thu Mar 11 14:28:22 2010

Hostname: 0.0.0.0

Port: 8080

2010-03-11 14:28:22 INFO ZServer FTP server started at Thu Mar 11 14:28:22 2010

Hostname: 0.0.0.0

Port: 8021

2010-03-11 14:28:22 INFO Zope Set effective user to "zope"

/web/science_1/Products/ExternalFile/ExternalFile.py:21: DeprecationWarning: 
MessageDialog is deprecated. import from App.Dialogs instead

  from Globals import MessageDialog

2010-03-11 14:28:22 ERROR Application Could not import Products.ExternalFile

Traceback (most recent call last):

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/OFS/Application.py",
 line 596, in import_product

product=__import__(pname, global_dict, global_dict, silly)

  File "/web/science_1/Products/ExternalFile/__init__.py", line 18, in 

from ExternalFile import manage_addExternalFileForm, addExternalFile

  File "/web/science_1/Products/ExternalFile/ExternalFile.py", line 36, in 


from IExternalFile import IExternalFile

  File "/web/science_1/Products/ExternalFile/IExternalFile.py", line 16, in 


from Interface import Base

ImportError: No module named Interface

Traceback (most recent call last):

  File "/web/bin/runzope", line 8, in 

load_entry_point('Zope2==2.12.2', 'console_scripts', 'runzope')()

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/Startup/run.py",
 line 21, in run

starter.prepare()

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/Startup/__init__.py",
 line 87, in prepare

self.startZope()

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/Startup/__init__.py",
 line 264, in startZope

Zope2.startup()

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/__init__.py",
 line 47, in startup

_startup()

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/App/startup.py",
 line 58, in startup

OFS.Application.import_products()

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/OFS/Application.py",
 line 573, in import_products

import_product(product_dir, product_name, raise_exc=debug_mode)

  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/OFS/Application.py",
 line 596, in import_product

product=__import__(pname, global_dict, global_dict, silly)

  File "/web/science_1/Products/ExternalFile/__init__.py", line 18, in 

from ExternalFile import manage_addExternalFileForm, addExternalFile

  File "/web/science_1/Products/ExternalFile/ExternalFile.py", line 36, in 


from IExternalFile import IExternalFile

  File "/web/science_1/

Re: [Zope] questions about migrating forwards

2010-03-10 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew Watkins wrote:
>
> My next step is to get the Products list that we were using
> running. Here I have run into two problems
>
> 1. ExternalFile
>
> This fails to load with the error 'ImportError: No module named
> Interface'  (stack trace below)
>
> I tested this with zope 2.11.4 and it works ok.
>
Likely incompatible. Zope 2.12 no longer supports old Zope 2-style
interfaces - only zope.interface is supported - ExternalFile needs to be
replaced with something else...or you application must be adjusted or
migrated...

>
> 2. ZMySQLDA
>
> This fails with the message 'ImportError: No module named _mysql'
>
> again this works ok on zope 2.11.4
>

Not a Zope problem. Likely your mysql-python installation in not working
correctly. The problem happens on the Python import level and has nothing
to do with Zope directly...perhaps file permission issue or a messed up
PYTHONPATH or sys.path or something like that. By using virtualenv,
you have
to make sure that your third-party modules are installed within the
virtualenv
environment. This is *purpose* of virtualenv: isolated environments.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuYZssACgkQCJIWIbr9KYwcRgCgoRuHvKyXehi1yzcxUDVzc1CR
6kIAn1qVFBh7SyBO7OI4w6sNlNy5cEWl
=9cF4
-END PGP SIGNATURE-

<>___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] questions about migrating forwards

2010-03-10 Thread Andrew Watkins

Hi list 
We have a legacy web service that is running on Zope 2.6.2 with Python 2.3.3 

For various reasons - security, maintenance etc we have decide to try migrating 
this forward to a current version of python and zope.  
e.g. Python 2.6 + Zope 2.12.2  

I have a new clean SUSE linux 11 installation with the correct python, 
setuptools and I am using virtualenv to create a sandbox 

I have installed the zope 2.12.2 and configured it in much the same way as the 
older system - (zeo with two data files, + 1 zope instance.) 

All is good and I can start up the instance and access the management pages. 

My next step is to get the Products list that we were using running.  Here I 
have run into two problems 
1. ExternalFile 
This fails to load with the error 'ImportError: No module named Interface'  
(stack trace below) 
I tested this with zope 2.11.4 and it works ok. 

2. ZMySQLDA 
This fails with the message 'ImportError: No module named _mysql' 
again this works ok on zope 2.11.4 

So I guess there is a key step that I am missing out or a path, or installation 
that is required. 
The main difference is that 2.12 is installed using virtualenv and then 
easy_install 

e.g. bin/easy_install -i http://download.zope.org/Zope2/index/2.12.2 Zope2 

Are there known incompatabilities with these Products ?  or is my installation 
just not quite right. 

Thanks Andrew 



stack trace for loading ExternalFile 
{code} 
/web/science_1/bin # ./zopectl fg 
/web/science_1/bin/runzope -X debug-mode=on 
2010-03-11 14:28:22 INFO ZServer HTTP server started at Thu Mar 11 14:28:22 
2010 
Hostname: 0.0.0.0 
Port: 8080 
2010-03-11 14:28:22 INFO ZServer FTP server started at Thu Mar 11 14:28:22 2010 
Hostname: 0.0.0.0 
Port: 8021 
2010-03-11 14:28:22 INFO Zope Set effective user to "zope" 
/web/science_1/Products/ExternalFile/ExternalFile.py:21: DeprecationWarning: 
MessageDialog is deprecated. import from App.Dialogs instead 
  from Globals import MessageDialog 
2010-03-11 14:28:22 ERROR Application Could not import Products.ExternalFile 
Traceback (most recent call last): 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/OFS/Application.py",
 line 596, in import_product 
product=__import__(pname, global_dict, global_dict, silly) 
  File "/web/science_1/Products/ExternalFile/__init__.py", line 18, in  
from ExternalFile import manage_addExternalFileForm, addExternalFile 
  File "/web/science_1/Products/ExternalFile/ExternalFile.py", line 36, in 
 
from IExternalFile import IExternalFile 
  File "/web/science_1/Products/ExternalFile/IExternalFile.py", line 16, in 
 
from Interface import Base 
ImportError: No module named Interface 
Traceback (most recent call last): 
  File "/web/bin/runzope", line 8, in  
load_entry_point('Zope2==2.12.2', 'console_scripts', 'runzope')() 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/Startup/run.py",
 line 21, in run 
starter.prepare() 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/Startup/__init__.py",
 line 87, in prepare 
self.startZope() 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/Startup/__init__.py",
 line 264, in startZope 
Zope2.startup() 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/__init__.py",
 line 47, in startup 
_startup() 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/Zope2/App/startup.py",
 line 58, in startup 
OFS.Application.import_products() 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/OFS/Application.py",
 line 573, in import_products 
import_product(product_dir, product_name, raise_exc=debug_mode) 
  File 
"/web/lib/python2.6/site-packages/Zope2-2.12.2-py2.6-linux-x86_64.egg/OFS/Application.py",
 line 596, in import_product 
product=__import__(pname, global_dict, global_dict, silly) 
  File "/web/science_1/Products/ExternalFile/__init__.py", line 18, in  
from ExternalFile import manage_addExternalFileForm, addExternalFile 
  File "/web/science_1/Products/ExternalFile/ExternalFile.py", line 36, in 
 
from IExternalFile import IExternalFile 
  File "/web/science_1/Products/ExternalFile/IExternalFile.py", line 16, in 
 
from Interface import Base 
ImportError: No module named Interface 
{code} 

{code} 
(web)horatio:/web/science_1 # bin/zopectl fg 
/web/science_1/bin/runzope -X debug-mode=on 
2010-03-11 15:14:58 INFO ZServer HTTP server started at Thu Mar 11 15:14:58 
2010 
Hostname: 0.0.0.0 
Port: 8080 
2010-03-11 15:14:58 INFO ZServer FTP server started at Thu Mar 11 15:14:58 2010 
Hostname: 0.0.0.0 
Port: 8021 
2010-03-11 15:14:58 INFO Zope Set effective user to "zope" 
/web/science_1/Products/Photo/Photo.py:36: DeprecationWarning: Persistent is 
deprecated. import from Persistence instead 
  from Globals import Persistent 
/web/science_1/Products/Photo/Photo.py:42: