2012-08-12 54 views
1

我有一個非常令人沮喪的開始學習Plone開發。我想爲Plone 4開發一個基於靈活性的內容類型。我是一名經驗豐富的Python開發人員,對Zope和Grok有一定的瞭解,對於構建而言是相當新穎的。也就是說,我讀了Martin Aspeli的「專業Plone 4開發」,但書中的一些版本信息似乎已經過時了。爲plone實現一個簡單靈活的內容類型4

使用buildout我能夠啓動並運行Plone實例。的ZopeSkel安裝,但是當我嘗試創建一個新的包,我得到這樣一個錯誤:

************************************************************************** 
** Your new package supports local commands. To access them, change 
** directories into the 'src' directory inside your new package. 
** From there, you will be able to run the command `paster add 
** --list` to see the local commands available for this package. 
************************************************************************** 


ERROR: No egg-info directory found (looked in ./domma.voucher/./domma.voucher.egg-info, ./domma.voucher/bootstrap.py/domma.voucher.egg-info, ./domma.voucher/bootstrap.pyo/domma.voucher.egg-info, ./domma.voucher/buildout.cfg/domma.voucher.egg-info, ./domma.voucher/CHANGES.txt/domma.voucher.egg-info, ./domma.voucher/CONTRIBUTORS.txt/domma.voucher.egg-info, ./domma.voucher/docs/domma.voucher.egg-info, ./domma.voucher/domma/domma.voucher.egg-info, ./domma.voucher/README.txt/domma.voucher.egg-info, ./domma.voucher/setup.cfg/domma.voucher.egg-info, ./domma.voucher/setup.py/domma.voucher.egg-info, ./domma.voucher/src/domma.voucher.egg-info) 

如果我嘗試從給定的目錄中運行貼紙,它告訴我,該命令「添加」是不知道。我嘗試了ZopeSkel的不同版本,嘗試了原始的plone模板和zopeskel.dexterity。輸出根據版本和模板而稍有變化,但結果保持不變。

Obvisouly Plone開發似乎對版本更改非常明智,這使得舊的文檔相當無用。 http://plone.org/products/dexterity/documentation/manual/developer-manual告訴我,它已在1114前上次更新。

有人能給我一個出發點,爲Plone 4開發一個非常簡單的靈巧內容類型,它真的有效嗎?

+0

您是否正在使用您正在運行正確的ZopeSkel版本? – 2012-08-12 17:44:54

回答

3

對於什麼是值得的,雖然有一些包的幾個較新版本,專業Plone 4開發目前與Plone 4.1。我建議你使用它,並從它的示例代碼開始。除非你知道你有一個工作的起點,否則不要試圖任意升級,你應該沒問題。

+0

這是一個版本問題,但是非常愚蠢:我使用Python 2.7而不是2.6。似乎會導致各種奇怪的錯誤。我切換到2.6,現在一切都看起來好多了。我會盡力繼續我的旅程。對不起,這完全是我的錯! – Achim 2012-08-21 06:16:12

2

http://pigeonflight.blogspot.com/2012/01/dexterity-development-quickstart-using.html提供了一個很好的快速入門。最新的敏捷文檔在http://dexterity-developer-manual.readthedocs.org/en/latest/index.html。是的,這僅僅是一個移動目標,而不是文件上的原因,而不是由於敏捷性,這是穩定的和在生產中,但主要是因爲Zopeskel正在大力發展/現代化。對於那個很抱歉。

+1

即使某些頁面在一段時間內沒有更新,敏捷手冊也不會過時,因爲它是值得的。 – optilude 2012-08-12 16:05:43

+0

截至目前,http://dexterity-developer-manual.readthedocs.org/en/latest/index.html鏈接不再有效;目前,敏捷開發者手冊是[here](https://docs.plone.org/external/plone.app.dexterity/docs)([Plone 4版本](https://docs.plone.org/4/ en/external/plone.app.dexterity/docs)) – Tobias 2017-11-09 08:55:38

1

我能夠使用這個擴展創建一個新的靈巧內容類型的新Plone 4.1.4網站。這不應該是一個正式的答案,但將配置粘貼到像pastebin這樣的易失性服務不是永久性文檔的選項。

# buildout.cfg file for Plone 4 development work 
# - for production installations please use http://plone.org/download 
# Each part has more information about its recipe on PyPi 
# http://pypi.python.org/pypi 
# ... just reach by the recipe name 
[buildout] 
parts = 
    instance 
    zopepy 
    i18ndude 
    zopeskel 
    test 
# omelette 

extends = 
    http://dist.plone.org/release/4.1-latest/versions.cfg 
    http://good-py.appspot.com/release/dexterity/1.2.1?plone=4.1.4 

# Add additional egg download sources here. dist.plone.org contains archives 
# of Plone packages. 
find-links = 
    http://dist.plone.org/release/4.1-latest 
    http://dist.plone.org/thirdparty 

extensions = 
    mr.developer 
    buildout.dumppickedversions 

sources = sources 

versions = versions 

auto-checkout = 
    nva.borrow 

# Create bin/instance command to manage Zope start up and shutdown 
[instance] 
recipe = plone.recipe.zope2instance 
user = admin:admin 
http-address = 16080 
debug-mode = off 
verbose-security = on 
blob-storage = var/blobstorage 
zope-conf-additional = %import sauna.reload 

eggs = 
    Pillow 
    Plone 
    nva.borrow 
    sauna.reload 
    plone.app.dexterity 

# Some pre-Plone 3.3 packages may need you to register the package name here in 
# order their configure.zcml to be run (http://plone.org/products/plone/roadmap/247) 
# - this is never required for packages in the Products namespace (Products.*) 
zcml = 
# nva.borrow 
    sauna.reload 


# zopepy commands allows you to execute Python scripts using a PYTHONPATH 
# including all the configured eggs 
[zopepy] 
recipe = zc.recipe.egg 
eggs = ${instance:eggs} 
interpreter = zopepy 
scripts = zopepy 

# create bin/i18ndude command 
[i18ndude] 
unzip = true 
recipe = zc.recipe.egg 
eggs = i18ndude 

# create bin/test command 
[test] 
recipe = zc.recipe.testrunner 
defaults = ['--auto-color', '--auto-progress'] 
eggs = 
    ${instance:eggs} 

# create ZopeSkel and paster commands with dexterity support 
[zopeskel] 
recipe = zc.recipe.egg 
eggs = 
    ZopeSkel<=2.99 
    PasteScript 
    zopeskel.dexterity<=2.99 
    ${instance:eggs} 

# symlinks all Python source code to parts/omelette folder when buildout is run 
# windows users will need to install additional software for this part to build 
# correctly. See http://pypi.python.org/pypi/collective.recipe.omelette for 
# relevant details. 
# [omelette] 
# recipe = collective.recipe.omelette 
# eggs = ${instance:eggs} 

# Put your mr.developer managed source code repositories here, see 
# http://pypi.python.org/pypi/mr.developer for details on the format of 
# this part 
[sources] 
nva.borrow = svn https://novareto.googlecode.com/svn/nva.borrow/trunk 

# Version pindowns for new style products go here - this section extends one 
# provided in http://dist.plone.org/release/ 
[versions] 
+1

只是好奇:您正在擴展http://dist.plone.org/release/4.2-latest/versions.cfg創建一個Plone 4.1.4網站? – Achim 2012-08-12 19:55:47

+0

這可能是由一個以前的ZopeSkel呼叫 – 2012-08-13 04:08:56

+0

我創建了一個新的virtualenv罪魁禍首,複製你的buildout.cfg,運行boostrap.py和斌/擴建。能夠啓動bin/instance fg(帶有一些警告)。試圖在我的src文件夾中運行「../bin/zopeskel plone domma.contenta」。結果在「ImportError:No module named util.template」。 – Achim 2012-08-14 13:52:03

2

從[https://github.com/collective/templer.plone/blob/master/README.txt][1]

坦普勒不能與舊的ZopeSkel共存於相同的附加件,或Python virtualenv。

否則,你將要創建的軟件包::

IOError: No egg-info directory found (looked in ./mycompany.content/./mycompany.content.egg-info, .... 

鄧普勒是的ZopeSkel的最新的化身(第3版)時遇到以下錯誤。我不確定你有什麼版本的ZopeSkel,或者你是否在buildout或virtualenv中安裝了混合版本。但ZopeSkel的衝突安裝可能是罪魁禍首。

我會從頭開始,重新創建vitualenv,並通過buildout安裝最新版本的ZopeSkel 2。 ZopeSkel 3或Templer仍處於繁重的發展階段,並非所有模板都已遷移。

相關問題