Invalide syntax on (of all things) def initialize(context):
As impossible as it seems, my Zope 2-3-1 had the temerity to say this __init__.py.... import Doctrine def initialize(context): """Initialize the Legal Doctrine Product.""" context.registerClass( Doctrine.Doctrine, constructors = ( Doctrine.manage_addDoctrineForm, Doctrine.manage_addDoctrine ), icon = 'images/Doctrine.jpg' ) .. gave me this... Import Traceback Traceback (innermost last): File "/usr/local/zope/2-3-1/lib/python/OFS/Application.py", line 536, in import_products product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope/2-3-1/lib/python/Products/LegalDoctrine/__init__.py", line 3 def initialize(context): ^ SyntaxError: invalid syntax I've seen def initialize(context): done for several different Zope products. Does my instance of Zope just not like me? Someone please tell me that I'm not crazy. Ron
First check your indentation. The 'icon' line seems to break the code. Andreas ----- Original Message ----- From: <complaw@hal-pc.org> To: <zope@zope.org> Sent: Donnerstag, 23. August 2001 11:35 Subject: [Zope] Invalide syntax on (of all things) def initialize(context):
As impossible as it seems, my Zope 2-3-1 had the temerity to say this __init__.py....
import Doctrine
def initialize(context): """Initialize the Legal Doctrine Product."""
context.registerClass( Doctrine.Doctrine, constructors = ( Doctrine.manage_addDoctrineForm, Doctrine.manage_addDoctrine ), icon = 'images/Doctrine.jpg' )
.. gave me this...
Import Traceback
Traceback (innermost last): File "/usr/local/zope/2-3-1/lib/python/OFS/Application.py", line 536, in import_products product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope/2-3-1/lib/python/Products/LegalDoctrine/__init__.py", line 3 def initialize(context): ^ SyntaxError: invalid syntax
I've seen def initialize(context): done for several different Zope products. Does my instance of Zope just not like me? Someone please tell me that I'm not crazy.
Ron
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
complaw@hal-pc.org writes:
As impossible as it seems, my Zope 2-3-1 had the temerity to say this __init__.py....
import Doctrine
def initialize(context): """Initialize the Legal Doctrine Product."""
context.registerClass( Doctrine.Doctrine, constructors = ( Doctrine.manage_addDoctrineForm, Doctrine.manage_addDoctrine ), icon = 'images/Doctrine.jpg' )
... gave me this...
Import Traceback
Traceback (innermost last): File "/usr/local/zope/2-3-1/lib/python/OFS/Application.py", line 536, in import_products product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope/2-3-1/lib/python/Products/LegalDoctrine/__init__.py", line 3 def initialize(context): ^ SyntaxError: invalid syntax
I've seen def initialize(context): done for several different Zope products. Does my instance of Zope just not like me? Someone please tell me that I'm not crazy. You are (probably) not crazy!
Sometimes, Zope betrays you... It shows you an old traceback in the Product folder. I have been hit by this, too, and chased the apparent problem for several hours... The solution: activate Zope logging mechanism by providing a parameter "STUPID_LOG_FILE=yourlog" to "z2.py". Restart Zope and look into "yourlog". It should tell you the real problem. Once this real problem is solved, the old traceback will disappear... Dieter
participants (3)
-
Andreas Jung -
complaw@hal-pc.org -
Dieter Maurer