[Zope-dev] Products in Zope 2.12+

Hanno Schlichting hanno at hannosch.eu
Wed Aug 4 05:20:15 EDT 2010


On Wed, Aug 4, 2010 at 11:13 AM, Chris Withers <chris at simplistix.co.uk> 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


More information about the Zope-Dev mailing list