Skip to main content

Posts

Showing posts from November, 2010

Hooking zope.component to any python project

Zope Component Architecture is a set of libraries used for aiding in writing component based applications using python. It provides some useful libraries to handle common patterns such as factory, adapter, multiadapter, and subscribers.

In Inigo, we utilizes Zope Component Architecture widely in our development process as it helps us in decoupling components in our system.

Anyway, lets get straight to the point of this post. Basically, what I'll go through in this post would be one method of hooking zope.component together with a configure.zcml into your current python project. It might not be the best way, but the simplest that I know of.

Requirements

You'll need to have these installed in your python environment: zope.component, zope.configuration.Your project is packaged as an egg (probably possible if not as an egg, but I never tried that)

Setting up

In your project egg module directory, create a file called configure.zcml with this content:

<configure xmlns="http://name…