Downsides of moving from Products to lib/python?

Maurits van Rees m.van.rees at
Fri Aug 24 21:18:50 UTC 2007


The lib/python directory of a Zope instance seems to become a popular
place for putting things and rightfully so.  I can imagine that in a
few years time the Products dir becomes totally empty and that zope
only uses packages in lib/python.

But I wonder if there are (perhaps temporarily) downsides to that.
I bumped my toe the past week with two such issues:

1. zcml files are not loaded automatically.  This is no big deal
   really, as there are a few ways to solve this:

   - You can do an <include package="..." /> in a zcml file somewhere
     in the Products dir.

   - I heard ploneout does some hacking to the path to make sure these
     zcmls in lib/python get loaded too.

   - You can put zcml "slugs" (one-liners) in etc/site.zcml or

2. Translations from i18n and locales directories do not get loaded.
   You can add <i18n:registerTranslations directory="locales" /> and
   then that will get loaded, but this is done in a Zope 3 way that is
   not getting picked by the Zope 2 or Plone translation machinery.
   For starters, the po files do not get listed in the PTS in the
   Zope Control Panel.

   Plone 3.0 of course has templates in lib/python that need
   translations.  But those translations are in
   Products/PloneTranslations, so they get picked up as usual.

   So if you want to have a package in lib/python that needs
   translation, then you will also have to make a Product for the
   Products dir that contains the actual translations.

So I have two questions really:

A. Is there a way to have po files in lib/python get picked up by
   Zope 2 after all?

B. Are there more of these gotchas that developers should know?


Maurits van Rees | [NL]
            Work |
"Do not worry about your difficulties in computers,
 I can assure you mine are still greater."

More information about the Product-Developers mailing list