[Zope] Problem refreshing a python product

Jim Washington jwashin@vt.edu
Tue, 13 Mar 2001 08:19:27 -0500


Hi, Troy

Assuming the traceback below is what you are getting now, I would look
somewhere around line 30 in ZProductManager.py.  But that's just a
guess.  Are you running Zope in debug mode?  (Look for -D in
/home/zope/Zope-2.3.1b1-src/start).  Code problems with Products usually
show up on the terminal where you start zope, if you are in debug mode.

-- Jim Washington

"Farrell, Troy" wrote:
> 
> Ok.  Did that and deleted the pyc's.  Now the Product isn't showing up on
> the product page.  If I undelete it, it keeps the same traceback.
> 
> Debug:
> Zope version: Zope 2.3.1b1 (source release, python 1.5.2, linux2)
> Python version: 1.5.2 (#0, Apr 3 2000, 14:46:48) [GCC 2.95.2 20000313
> (Debian GNU/Linux)]
> System Platform: linux2
> Process ID: 7707 (4101)
> Running for: 3 min 23 sec
> 
> Traceback:
> Traceback (innermost last):
>   File "/home/zope/Zope-2.3.1b1-src/lib/python/OFS/Application.py", line
> 537, in import_products
>     product=__import__(pname, global_dict, global_dict, silly)
>   File "/home/zope/zope/lib/python/Products/ZProductManager/__init__.py",
> line 2, in ?
>     from ZProductManager import ZProductManager
>   File
> "/home/zope/zope/lib/python/Products/ZProductManager/ZProductManager.py",
> line 30
>      if REQUEST is not None:
>       ^
>  SyntaxError: invalid syntax
> 
> I moved the product out of the zope directory structure and restarted.  It
> was gone. Good.  I brought it back in and restarted and it isn't showing up.
> That sounds like a problem in my __init__.py file.  It is below if you don't
> mind looking it over:
> 
> from ZProductManager import ZProductManager
> 
> def initialize(context):
>   """Initalize the ZProductManager product.
>   This causes it to appear on the product list
>   in the Zope installation."""
>   context.registerClass(
>     ZProductManager,
>     contructors = (
>       ZProductManager.manage_addZProductManagerForm, # The first method
>                                                      # is called when
> someone
>                                                      # adds the product
>       ZProductManager.manage_addZProductManager
> 
>     )
>   )
> 
> If it helps, I'll send ZProductManager.py as well.