[Zope-ZEO] Breaking ZServer dependence on ZPublisher

Jim Fulton jim@digicool.com
Wed, 06 Sep 2000 09:16:42 -0400


The only reason we import ZServer is to
get the latest asyncore. We should make ZServer optional and
tell people to make sure they have the latest asyncore if they don't
have ZServer. I'm open to suggestions about how best to achiev this.....

It makes no sense to make ZServer work without
ZPublisher. 

What version of asyncore is in version 1.6? 2.0? ...
Ya know, I'm not even sure how to check.....

Let's see, the CNRI CVS, which I assume reflects Python 1.6
has an out of date asyncore.....

Just downloaded Pythob 2.0b1, it has an out of date asyncore.

Damn. ... Damn. Damn. Damn.

<rant>3rd party modules shouldn't be included in Python
unless they are going to be maintained. LESS REALLY IS MORE!
</rant>

Hm maybe it's time to fork asyncore. :( Or at least to include a separate
distribution of it.  

For now, I think you should:

 - include the asyncore.py from ZServer

 - Make sure it gets installed ahead of the Python-distributed
   one

 - I need to change ZEO so it doesn't
   import asyncore from ZServer. I know I didn't *want* to 
   import asyncore from ZServer. I must have done it in a 
   moment of weakness. :/  

Jim

Andrew Kuchling wrote:
> 
> 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
> 
> _______________________________________________
> Bug reports, feature requests, etc. go in the ZEO Tracker:
> http://www.zope.org/Products/ZEO/Tracker
> 
> Conversations etc. can take place in the Wiki:
> http://www.zope.org/Products/ZEO/Wiki
> 
> Zope-ZEO maillist  -  Zope-ZEO@zope.org
> http://lists.zope.org/mailman/listinfo/zope-zeo


--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.