Add a module (not package) to buildout for Plone
Is there a way to add a simple module (e.g. mymodule.py) w开发者_JS百科hich 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?
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.
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
精彩评论