|
|
8 User(s) Active on Site 233 Wiki Pages Most Recently Modified
Club Resources (edit)
How This Wiki Works
Check them out; they are a great source of technical books at very good prices! If you have shopped at Nerdbooks.com, help them out by reviewing them at ResellerRatings.com. You will need your invoice number to prove you are a real customer, and not just ballot stuffing. |
|||
| Recent Changes Printable View Page History Edit Page | |||
|
Content Last Modified on October 25, 2005, at 01:36 AM CST
<< | ZopePackages | Define the interface(s) >> Where do I put my new package?In building something, it's always good to know where you stand, where to begin storing your work. Zope packages are simply Python packages, typically a directory located somewhere along the Python import path (PYTHONPATH). While placing your package on that path means Python can import it, Zope 3 uses no magical package detection facility and won't know about it until a special descriptor file (<package>-configure.zcml) is dropped into the "etc/package-includes/" directory of a particular instance of Zope. Typically Zope packages are placed underneath a "Zope 3 package root", of which there are several.
In my case my instance directory is "~/zope3", so let's create a directory named "bookmarker":
{jrush]# cd ~/zope3/lib/python
[jrush]# mkdir bookmarker
[jrush]# cd bookmarker
And then to make our new package "importable" to Python, create a nearly empty "__init__.py" file. I say nearly empty because while Python is happy with a completely empty file, some software distribution tools have trouble with empty files. [jrush]# cd ~/zope3/lib/python/bookmarker [jrush]# echo "# A Python Package" > __init__.py << | ZopePackages | Define the interface(s) >> |
|||
| Recent Changes Printable View Page History Edit Page | |||