John
John

Reputation: 1273

Add a module (not package) to buildout for Plone

Is there a way to add a simple module (e.g. mymodule.py) which resides in the src/ directory to buildout for Plone 4? To be more specific, I have a former module I used as an ExternalMethod in Plone 2.5, and I'm trying to use it in Plone 4 without creating a package or using paster and creating an egg. How would I do this?

Upvotes: 2

Views: 148

Answers (2)

Giacomo Spettoli
Giacomo Spettoli

Reputation: 4496

You have three options:

  • you could put it in a skin layer and use it with the Aquisition. But, if you used to use it as an ExternalMethod, I suppose it needs to be executed by a not-restricted python
  • make a package using the paster template "plone" for a basic package.
  • put it into /<buildout-root>/parts/instance/Extensions or /<buildout-root>/parts/client1/Extensions

You can find a similar question here.

edit: it turns out that the last option is not suitable...so you have only 2 options + the one from @djay

Upvotes: 0

djay
djay

Reputation: 1058

See http://pypi.python.org/pypi/plone.recipe.zope2instance You can just the extra_paths option. That would allow it to be imported from other code.

Upvotes: 4

Related Questions