[Zope] Problems with External Methods when starting Zope at boot time, Mac OS X

Andreas Reuleaux reuleaux@web.de
Sun, 21 Apr 2002 18:04:02 +0200


Hallo,

I have so far successfully installed Python 2.1.3 and Zope 2.5.0
on Mac OS X.1.3 (each from src).

My zope app makes use of an external method (located in the Extensions
dir) which in turn makes use of the reportlab (pdf) library.
(I unpacked the lib in /opt/reportlab which actually make a structure of
/opt/reportlab/reportlab/...)

When I start zope by hand with
  /opt/python2.1.3/bin/python.exe /opt/zope/Zope-2.5.0-src/z2.py -u reuleaux -w 9090 -f 9021 &
everything works fine, including the above mentioned external method.

However I wanted to start zope at boot time. I was lucky in the first
place to discover the daemonic pkg from the fink project.
I created an xml-file zope.xml in /sw/etc/daemons as follows

<service> 
<description>Zope server</description> 
<message>Zope server</message> 
<daemon name="zope"> 
<executable background="yes">/opt/python2.1.3/bin/python.exe</executable> 
<parameters>/opt/zope/Zope-2.5.0-src/z2.py -u reuleaux -w 9090 -f 9021</parameters> 
</daemon> 
</service>

and did a 
  sudo daemonic enable zope
this creates a startup item
  /Library/StartupItems/daemonic-zope/daemonic-zope
with effectivly the same line as above for starting by hand
  ...
  if [ -x /opt/python2.1.3/bin/python.exe ]; then
      # run the daemon
      /opt/python2.1.3/bin/python.exe /opt/zope/Zope-2.5.0-src/z2.py -u reuleaux -w 9090 -f 9021 &
  ...
and actually starts zope at boot time.
Everything works except for my external method
by the way: simple hello external methods work too,
but my method can't even import some names from the reportlab lib
here is an extract (I reduced it to what was absolutely neccessary):
I get: 
  Errror Type: Import Error
  Error Value: cannot import name BaseDocTemplate
---

import sys 
sys.path.append('/opt/reportlab')

import reportlab.platypus.doctemplate
from reportlab.platypus.doctemplate import BaseDocTemplate

class MyDocTempl(BaseDocTemplate):
    pass


def doc(story, fs, sB=0):
        doc=MyDocTempl('/tmp/ettiketten.pdf', pagesize=A4, showBoundary=sB) 


def ettikettenKlein(adrs):
    #
    return 'hello'

Any help is appreciated, thanks in advance,
  Andreas