[Zope3-Users] Re: zwiki addon

Derrick Hudson dman at dman13.dyndns.org
Thu Mar 17 16:39:37 EST 2005


On Wed, Mar 16, 2005 at 09:57:46PM -0500, Rob wrote:
| I installed x3 from the download distribution on fedora core 1 in
| /opt/zope3. I made an instance in /var/lib/zope3/main. This didn't have any
| issues. I'm reading the Developer's Handbook and I'm on the 'Installing new
| Zope Packages' chapter. The book says there is no package and say to get it
| from svn but there is one so I figured I try that since it was with the x3
| tarball. So I got the zwiki addon package tarball, configured it to install
| in /var/lib/zope3/main (I know the install text says prefix it with zope3
| home but I wanted to install it in the instance). It installed ok.
| 
| The install text refers to
| http://www.zope.org/DevHome/Wikis/DevSite/Projects/ComponentArchitecture/AddonPackageInstall
| 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 no
| 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 when
| 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?

google?

HTH,
-D

-- 
Emacs is a nice operating system, it lacks a decent editor though
 
www: http://dman13.dyndns.org/~dman/            jabber: dman at dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20050317/2f685cea/attachment.bin


More information about the Zope3-users mailing list