[Zodb-checkins] CVS: ZODB3/ZODB - config.py:1.1.4.5
Barry Warsaw
barry@wooz.org
Fri, 3 Jan 2003 14:03:20 -0500
Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv28120
Modified Files:
Tag: zconfig-schema-devel-branch
config.py
Log Message:
_bdbstorage(), fullstorage, minimalstorage: Support for BerkeleyDB
related storages.
=== ZODB3/ZODB/config.py 1.1.4.4 => 1.1.4.5 ===
--- ZODB3/ZODB/config.py:1.1.4.4 Fri Jan 3 01:18:18 2003
+++ ZODB3/ZODB/config.py Fri Jan 3 14:03:14 2003
@@ -67,6 +67,25 @@
stop=config.stop,
quota=config.quota)
+ def _bdbstorage(self, config):
+ from BDBStorage.BerkeleyBase import BerkeleyConfig
+ from BDBStorage.BDBFullStorage import BDBFullStorage
+ from BDBStorage.BDBMinimalStorage import BDBMinimalStorage
+ # Figure out which class we want
+ sectiontype = config.getSectionType()
+ storageclass = {'fullstorage': BDBFullStorage,
+ 'minimalstorage': BDBMinimalStorage,
+ }[sectiontype]
+ bconf = BerkeleyConfig()
+ for name in dir(BerkeleyConfig):
+ if name.startswith('_'):
+ continue
+ setattr(bconf, name, getattr(config, name))
+ return storageclass(config.name, config=bconf)
+
+ fullstorage = _bdbstorage
+ minimalstorage = _bdbstorage
+
def zeoclient(self, config):
from ZEO.ClientStorage import ClientStorage
# config.server is a multikey of socket-address values