工作對我來說:
[email protected]:~/Developer/test-4.1/src/ > paster create -t plone_app MyApp
Selected and implied templates:
ZopeSkel#nested_namespace A basic Python project with a nested namespace (2 dots in name)
ZopeSkel#plone_app A project for Plone products with a nested namespace (2 dots in name)
Variables:
egg: MyApp
package: myapp
project: MyApp
Expert Mode? (What question mode would you like? (easy/expert/all)?) ['easy']:
Version (Version number for project) ['1.0']:
Description (One-line description of the project) ['']:
Creating template nested_namespace
Creating directory ./MyApp
Recursing into +namespace_package+
Creating ./MyApp/MyApp/
Recursing into +namespace_package2+
Creating ./MyApp/MyApp/plone/
Recursing into +package+
Creating ./MyApp/MyApp/plone/MyApp/
Copying __init__.py_tmpl to ./MyApp/MyApp/plone/MyApp/__init__.py
Copying __init__.py_tmpl to ./MyApp/MyApp/plone/__init__.py
Copying __init__.py_tmpl to ./MyApp/MyApp/__init__.py
Copying README.txt_tmpl to ./MyApp/README.txt
Recursing into docs
Creating ./MyApp/docs/
Copying HISTORY.txt_tmpl to ./MyApp/docs/HISTORY.txt
Copying setup.py_tmpl to ./MyApp/setup.py
Creating template plone_app
Recursing into +namespace_package+
Recursing into +namespace_package2+
Recursing into +package+
Replace 0 bytes with 86 bytes (0/0 lines changed; 3 lines added)
Copying __init__.py_tmpl to ./MyApp/MyApp/plone/MyApp/__init__.py
Copying configure.zcml_tmpl to ./MyApp/MyApp/plone/MyApp/configure.zcml
Copying tests.py_tmpl to ./MyApp/MyApp/plone/MyApp/tests.py
Copying version.txt_tmpl to ./MyApp/MyApp/plone/MyApp/version.txt
Recursing into docs
Copying INSTALL.txt_tmpl to ./MyApp/docs/INSTALL.txt
Copying LICENSE.GPL to ./MyApp/docs/LICENSE.GPL
Copying LICENSE.txt_tmpl to ./MyApp/docs/LICENSE.txt
Replace 890 bytes with 973 bytes (0/32 lines changed; 4 lines added)
Copying setup.py_tmpl to ./MyApp/setup.py
隨着擴建:
[email protected]:~/Developer/test-4.1/ > cat buildout.cfg
[buildout]
extends = http://dist.aclark.net/build/plone/4.1.x/develop.cfg
develop = src/MyApp
[plone]
eggs +=
MyApp
顯然,這是不是您所期望雖然結果,貼紙創造了一個三重嵌套命名包名爲「MyApp.plone.MyApp」 :-)
進一步注意:除非您在MyApp/plone/MyApp/configure.zcml中添加GenericSetup配置文件,否則此應用將不會顯示在Plone附件中:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="MyApp.plone.MyApp">
<five:registerPackage package="." initialize=".initialize" />
<genericsetup:registerProfile
name="default"
title="MyApp"
directory="profiles/default"
description="MyApp"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
</configure>
那麼你應該看到:
![enter image description here](https://i.stack.imgur.com/jIwZH.png)
最後,沒有什麼「錯誤」與非命名的包,他們只是約定(超過平面命名空間封裝優點/缺點,並反之亦然)。參見:
用於 「平坦」 的命名空間的Plone包的一個例子。
*它怎麼會崩潰?如果你看到Zope,什麼都不會崩潰。你有任何錯誤? – 2011-05-26 22:13:13