[Zope] reading zope.config file for ClientStorage

Chris Withers chris at simplistix.co.uk
Wed Oct 12 03:52:51 EDT 2005


Mika, David P (Research) wrote:
> OK, the opts object really did have everything loaded.  On careful inspection the opts.configroot has an attribute "databases" with a list of Zope.Startup.datatypes.ZopeDatabase instances.  I can do what I originally set out to do which was to open a ZEO.ClientStorage configured from the zope-with-zeo.conf file (the ZEO.ClientStorage is now wrapped in a ZEOClient object):
> 
> from Zope.Startup import options, handlers
> opts = options.ZopeOptions()
> opts.configfile='c:\Zope-Instance-Test\etc\zope-with-zeo.conf'
> opts.load_schema()
> opts.load_configfile()
> for db in opts.configroot.databases:
>      if is instance(db.config.storage, ZODB.config.ZEOClient):
>           db.config.storage.open()

Great, right? Or am I missing some outstanding issue?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list