[Zope-dev] [ANN] pythonproducts 1.0beta1 released
Rocky Burt
rocky.burt at adaptivewave.com
Sun Apr 23 06:35:30 EDT 2006
I'm pleased to announce the first beta release of pythonproducts.
pythonproducts
==============
Description
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.
Author/Maintainer
`Rocky Burt <rocky at serverzen.com>`__
Latest Release
`1.0beta1
<http://dev.serverzen.com/site/projects/pythonproducts/releases/pythonproducts-1-0beta1-tar.gz/download>`__
License
BSD-style, see LICENSE.txt for details
Source Control
http://codespeak.net/svn/z3/pythonproducts/
Requirements
- Python 2.3.5 or higher in 2.3.x series
- Zope 2.8 or 2.9
- Five 1.2 or higher
Installing
Uses regular python distutils for installation. Simply run::
python ./setup.py install --home /some/path/to/zope_instance_home
Usage
Once pythonproducts has been installed, the standard practise of
installing
a python package as a Zope 2 product is as follows:
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
``
$INSTANCE_HOME/etc/package-includes/yourpackage-configure.zcml`` and
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 with
"-configure.zcml".
Regards,
Rocky
--
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple
More information about the Zope-Dev
mailing list