[Zope] Invalide syntax on (of all things) def initialize(context):

Andreas Jung Andreas Jung" <andreas@zope.com
Thu, 23 Aug 2001 12:46:03 -0400


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 )