[Zope3-Users] Re: zwiki addon

Rob rob at objectsource.org
Thu Mar 17 19:58:16 EST 2005

I have it in /var/lib/zope3/main/lib/python:

[root at casero main]# ls -al lib/python
total 16
drwxr-xr-x  3 root root 4096 Mar 16 20:51 .
drwxr-xr-x  3 root root 4096 Mar 16 20:26 ..
-rw-r--r--  1 root root  310 May 14  2004 README.txt
drwxr-xr-x  4 root root 4096 Mar 16 20:51 zwiki
[root at casero main]#

Copying the configure.zcml is what AddonPackageInstall url said to do if I
installed it in an instance. Well, maybe not in so many words:

a.. Any new Zope instance will now have this package at its disposal. If you
want to make the package available to existent Zope 3 instances, then you
have to manually install the '-configure.zcml' file to


While it might mean use an 'include' element in zwiki-configure.zcml, that's
what I tried first.

Here's the sys.path (I added the print just before the import/main call):

[root at casero bin]# ./zopectl stop
['/var/lib/zope3/main/lib/python', '/opt/zope3/lib/python',
'/var/lib/zope3/main/bin', '/usr/lib/python23.zip', '/usr/lib/python2.3',
'/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk',
'/usr/lib/python2.3/lib-dynload', '/usr/lib/python2.3/site-packages',

Well. I moved zwiki-configure.zcml (the full version) and put the 'include'
directive in it instead and it worked fine (after the first install was
already done anyway..meaning it may not be reading it again?). Maybe someday
I'll fresh install and try again...or see what some of the other addon
packages do.

Thanks for the info. It certainly helps to confirm how packages should be


----- Original Message ----- 
From: "Derrick Hudson" <dman at dman13.dyndns.org>
To: <zope3-users at zope.org>
Sent: Thursday, March 17, 2005 4:39 PM
Subject: [Zope3-Users] Re: zwiki addon
| The install text refers to
| which says to  "manually install the '-configure.zcml' file to
| '/etc/package-includes'.". The Developer's book says to add a file called
| zwiki-configure.zcml to etc/packages-include with the contents: <include
| package="zwiki"/>. The server errs with
| ConfigurationError: ('Invalid value for', 'package', 'Module zope.app has
| global zwiki')

This error occurs because python can not find any package named
'zwiki' in sys.path.

Put the 'zwiki' directory in /var/lib/zope3/main/lib/python.  That
directory is part of sys.path.

| I then copied the configure.zcml from lib/python/zwiki into
| etc/package-includes.

This is wrong, as you noticed :-).

Put that file back, and create zwiki-configure.zcml as the developer's
book says to (with the single <include> line).

| I started the server as a daemon using zopectl. It just restarts itself
| it encounters an error then eventually gives up.
| [Suddenly I have a bright idea and try it while writing this email]:
| It'd be neat if there was -t switch like httpd to test the config files
| (maybe I haven't seen it yet?).

You can run 'zopectl fg' to run zope in the foreground and watch its
stdout and stderr.

| I did a %s/="\./="zwiki\./g in vi on the zwiki-configure.zcml file and it
| worked.

That would happen to work, I guess, because you fully-qualified the
package name.  However, you're not supposed to move that file outside
of the package in the first place :-).

| The Developer's Handbook says  addon packages can be installed anywhere on
| the python path.

This is correct.

| I'm not a python/zope programmer (yet) so I was just taking
| a guess that adding zwiki resolved the package.

If you want to see what the path is, put
    import sys
    print sys.path
somewhere where it will be executed.

| I'm assuming this means zcml files should fully qualify packages to be on
| the safe side?

No, that would be too tedious.  It is an intentional feature that a
leading dot means to prepend the name with the current package name.
The configure.zcml belongs in the package's directory, and thus the
full name is unnecessary.

| Is there a reason I should the addon packages in x3 home as
| the above link indicates (aside from wanting to share the package with all
| my instances)?

That's the only reason I know of.  Putting the package in the
instance's lib/python/ directory is good if you don't want that
package (or that version) to be used by all your instances.

| Is there (or are there plans for) a search interface for the mailing list
| archives?



Emacs is a nice operating system, it lacks a decent editor though

www: http://dman13.dyndns.org/~dman/            jabber:
dman at dman13.dyndns.org

> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users

More information about the Zope3-users mailing list