开发者

Add a module (not package) to buildout for Plone

开发者 https://www.devze.com 2023-04-06 18:44 出处:网络
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 ExternalMeth

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号