Mika, David P (Research) wrote:
To initialize ZEO clients with ClientStorage I need info such as host, port, etc. All the needed stuff is tucked away nicely in the zope.config file and I would like to be using the zope machinery access it. I know that what I need is in there somewhere, but when I try to follow how it happens in say the Zope startup, I get lost in all the dependencies and my head starts swirling.
I would like to be able to use something like is in ZODB/config.py:
from ZEO.ClientStorage import ClientStorage
# config.server is a multikey of socket-address values
# where the value is a socket family, address tuple.
L = [server.address for server in self.config.server]
here BaseConfig has that bit of magic that has self.config.
I guess I need to know how to instantiate this class. Any ideas?
Have a look at the run.py file in Stepper:
It shows you how to parse zope.conf without having to start Zope up...
You may wish to wait for Stepper 1.3.0, though, which shows you how to
do this for both Zope 2.7 and Zope 2.8...
Simplistix - Content Management, Zope & Python Consulting
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -