Re: Products in Zope 2.12+

Hanno Schlichting <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On Wed, Aug 4, 2010 at 11:13 AM, Chris Withers <[email protected]> wrote:
> Okay, but what about:
>
> <include package="Products.Whatever" />
>
> ...causes Whatever/__init__.py's initialize method to get called?

Yes. Eggified products behave in the same way as code dumped into one
of the "products" directories.

If you have a package, which isn't in the "Products" namespace and
still want its initialize to be called, you need to add some bits to
your configure.zcml:

<five:registerPackage package="." initialize=".initialize" />

> Yeah, but it's setuptools namespace packages magic that makes sure __path__,
> which the old Zope 2 code iterates over, is set up correctly, right?

Sure.

Hanno
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.