[Zodb-checkins] CVS: ZODB3/ZConfig - StorageTypes.py:1.4
Barry Warsaw
barry@wooz.org
Fri, 22 Nov 2002 15:08:11 -0500
Update of /cvs-repository/ZODB3/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv23877
Modified Files:
StorageTypes.py
Log Message:
convertFullStorageArgs(), storage_types: Support Berkeley Full
storages.
=== ZODB3/ZConfig/StorageTypes.py 1.3 => 1.4 ===
--- ZODB3/ZConfig/StorageTypes.py:1.3 Fri Nov 22 13:13:32 2002
+++ ZODB3/ZConfig/StorageTypes.py Fri Nov 22 15:08:10 2002
@@ -92,10 +92,29 @@
return kw
+def convertFullStorageArgs(**kw):
+ from bsddb3Storage.BerkeleyBase import BerkeleyConfig
+ config = BerkeleyConfig()
+ for name in dir(BerkeleyConfig):
+ if name.startswith('_'):
+ continue
+ val = kw.get(name)
+ if val is not None:
+ if name != 'logdir':
+ val = int(val)
+ setattr(config, name, val)
+ del kw[name]
+ # XXX: Nobody ever passes in env
+ assert not kw.has_key('env')
+ kw['config'] = config
+ return kw
+
+
storage_types = {
'FileStorage': ('ZODB.FileStorage', convertFileStorageArgs),
'DemoStorage': ('ZODB.DemoStorage', None),
'MappingStorage': ('ZODB.MappingStorage', None),
'TemporaryStorage': ('Products.TemporaryFolder.TemporaryStorage', None),
'ClientStorage': ('ZEO.ClientStorage', convertClientStorageArgs),
+ 'Full': ('bsddb3Storage.Full', convertFullStorageArgs),
}