添加一个模块(不是包)来构建 Plone
有没有办法添加一个驻留在 src/ 目录中的简单模块(例如 mymodule.py)来构建 Plone 4?更具体地说,我有一个以前的模块,在 Plone 2.5 中用作外部方法,并且我尝试在 Plone 4 中使用它,而不创建包或使用粘贴并创建鸡蛋。我该怎么做?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅http://pypi.python.org/pypi/plone.recipe.zope2instance
您可以只使用 extra_paths 选项。这将允许它从其他代码导入。
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.
您有三个选择:
如果您曾经将它用作外部方法,我想它需要是
由不受限制的 python 执行,
//parts/instance/Extensions
或//parts/client1/Extensions
你可以找到类似的问题此处。
编辑:事实证明最后一个选项不合适......所以你只有2个选项+来自@djay的选项
You have three options:
if you used to use it as an ExternalMethod, I suppose it needs to be
executed by a not-restricted python
/<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