I've now made available the first public release of pythonproducts.
A mechanism to construct Zope 2 products as regular python
packages. This enables a python package to be deployed as a
Zope 2 product using a similar strategy as Zope 3.
`Rocky Burt <[EMAIL PROTECTED]>`__
BSD-style, see LICENSE.txt for details
- Python 2.3.5 or higher in 2.3.x series
- Zope 2.8.4 or higher in 2.8.x series
- Five 1.2 or higher
Uses regular python distutils for installation. Simply run::
./setup.py install --home /some/path/to/zope_instance_home
Once pythonproducts has been installed, the standard practise
of installing a python package as a Zope 2 product is as
1. edit (or create it if it doesn't exist already)
``$YOUR_PKG_SOURCE/configure.zcml`` and add the line
``<five:registerPackage package="." initialize=".initialize" />``
2. copy your python package to ``$INSTANCE_HOME/lib/python``
3. create a ZCML "slug" by creating the file
populating it with ``<configure package="yourpackage" />``
Explanation of Usage
Step 1: Your python package needs to register itself as a
Zope 2 product. This is accomplished by using the new
``registerPackage`` directive. This directive takes a
(required) "package" attribute which declares any python
package as a Zope 2 product (with "." meaning this package).
Another (optional) attribute is the 'initialize' attribute.
If this attribute is defined, a function with that name
will be invoked in a traditional Zope 2 style with a
ProductContext instance as the sole argument.
Step 2: Your python package needs to exist *somewhere* on
PYTHONPATH. With Zope 2.8, $INSTANCE_HOME/lib/python is
added to the PYTHONPATH so copying your python package
there ensures its somewhere in PYTHONPATH. But really your
python package could be copied to any directory that exists
on PYTHONPATH (ie /usr/lib/python2.3/site-packages).
Step 3: The standard way of registering a package with Zope 3 is
to create a ZCML "slug" in the $INSTANCE_HOME/etc/package-includes
directory. This file can be called anything as long as it ends
AdaptiveWave - Consulting, Training, and Content Management as a Service
Content Management Made Simple
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -