[Zope-ZEO] Breaking ZServer dependence on ZPublisher

Andrew Kuchling akuchlin@mems-exchange.org
Tue, 5 Sep 2000 16:04:32 -0400


I'm still working on packaging ZEO, and am slowly making progress.
The problem I've just hit is that ZServer doesn't work unless
ZPublisher is installed:

kronos akuchlin>/usr/bin/python1.5 -i /tmp/t.py
Traceback (innermost last):
  File "/tmp/t.py", line 2, in ?
    from ZEO import ClientStorage
  File "/usr/lib/python1.5/site-packages/ZEO/ClientStorage.py", line 89, in ?
    import struct, time, os, socket, string, Sync, zrpc, ClientCache
  File "/usr/lib/python1.5/site-packages/ZEO/zrpc.py", line 92, in ?
    from smac import SizedMessageAsyncConnection
  File "/usr/lib/python1.5/site-packages/ZEO/smac.py", line 91, in ?
    from ZServer.medusa import asyncore
  File "/usr/lib/python1.5/site-packages/ZServer/__init__.py", line 128, in ?
    from PubCore import setNumberOfThreads
  File "/usr/lib/python1.5/site-packages/ZServer/PubCore/__init__.py", line 86,
in ?
    import ZRendezvous
  File "/usr/lib/python1.5/site-packages/ZServer/PubCore/ZRendezvous.py", line 87, in ?
    from ZServerPublisher import ZServerPublisher
  File "/usr/lib/python1.5/site-packages/ZServer/PubCore/ZServerPublisher.py", line 85, in ?
    from ZPublisher import publish_module
ImportError: No module named ZPublisher

I'm still digging into this, but thought I'd ask first: is it possible
to break this dependence?  I'm only interested in what ClientStorage
needs, and it's not obvious why using ClientStorage would require
ZPublisher code at all, so perhaps imports can be rearranged to fix
the problem.  I've found that commenting out the following block in
ZServer/__init__.py fixes things, but it's a bit much:

#from HTTPServer import zhttp_server, zhttp_handler
#from PCGIServer import PCGIServer
#from FCGIServer import FCGIServer
#from FTPServer import FTPServer
#from PubCore import setNumberOfThreads
#from medusa.monitor import secure_monitor_server

--amk