hello all, I want to document the recommended structure of a product. I blogged about this at http://blog.delaguardia.com.mx/index.php?op=ViewArticle&articleId=30&blogId=... . I would like some comments on what I believe are the possible structures. First, here's more or less what everybody uses these days: - / MyProduct - | __init__.py - | config.py - | MyProduct.py - | utils.py - / docs - / zpt - / www - / tests I'm not sure whether to include a help directory anymore. Maybe I'm wrong, but I don't think many people use the Zope management help API. But if one is going to work with Zope 2.8 and use Five, there is also this possibility, which also has some common elements with Plone/CMF structures: - / MyProduct - | __init__.py - | MyProduct.py - | configure.zcml - | browser.py - | interfaces.py - | utils.py - / adapters - / docs - / skins - / tests Some people seem to use an interfaces directory instead of a file, and the same thing happens with browser.py. I still have to do some research about this and explain all the parts at least briefly, but I wanted to see if anyone wants to comment on this first. Thanks, Carlos de la Guardia
On 1/15/06, Carlos de la Guardia <carlos.delaguardia@gmail.com> wrote:
First, here's more or less what everybody uses these days:
/ MyProduct
| __init__.py | config.py | MyProduct.py | utils.py / docs / zpt / www / tests
Both zpt and www? I use only www or zmi for zmi support, and skins if it's for CMF. Although nowadays I try to use Five and hence use neither? ;-) config.py and utils.py is not any type of standard, and people are moving from the old MyProduct.py to myproduct.py, which is more python-standard. I use /doc, not /docs, but maybe that's just me.
I'm not sure whether to include a help directory anymore. Maybe I'm wrong, but I don't think many people use the Zope management help API.
No, you are right. I would recommend: / MyProduct | __init__.py | MyProduct.py / doc / zmi / tests for a Zope 2 product, with /skins added if it's CMF.
But if one is going to work with Zope 2.8 and use Five, there is also this possibility, which also has some common elements with Plone/CMF structures:
/ MyProduct
| __init__.py | MyProduct.py | configure.zcml | browser.py | interfaces.py | utils.py / adapters / docs / skins / tests
Add /locales for translations and remove /skins which has nothing to do in a Five product. It's a CMF thingy (of course you may have skins in a Five product as well, but it's not a part of the Five, but CMF). Here, it is a definite no-no to have capitalized file names, so it should be myproduct.py. I don't know what utils.py does here either. note that both adapters, browsers and interfaces can either be .py files or directories, depending on if you have many of each or not. :-) browser.py often does that, and besides, the browser-directory is a good place to have the zpts. So I would say: / MyProduct | __init__.py | myproduct.py | configure.zcml | interfaces.py / browser | __init__.py | configure.zcml | aview.py | aview.pt / doc / tests / locales with adapters.py added if you have many adapters, and interfaces.py and adapters.py be made into directories if they grow big. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On Sun, 15 Jan 2006 13:18:54 +0100 Lennart Regebro <regebro@gmail.com> wrote:
Both zpt and www? I use only www or zmi for zmi support, and skins if it's for CMF. Although nowadays I try to use Five and hence use neither? ;-)
'www' is usually for images and other static resources. Because I use my own image build process (BuildImage), to create resources from vector originals, I actually build 'www' from a tree under 'src', so it is desireable not to have zpt or dtml source files in it. Mind you, I've been inactive for awhile, so I haven't really caught up with 'Five' or Zope 3 based products. -- Terry Hancock (hancock@AnansiSpaceworks.com) Anansi Spaceworks http://www.AnansiSpaceworks.com
participants (3)
-
Carlos de la Guardia -
Lennart Regebro -
Terry Hancock