[Zope-Checkins] CVS: Zope3/lib/python/ZODB - MappingStorage.py:1.8
Jeremy Hylton
jeremy@zope.com
Mon, 24 Jun 2002 09:46:08 -0400
Update of /cvs-repository/Zope3/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv9151
Modified Files:
MappingStorage.py
Log Message:
Add DB helper function.
Cleanup imports and remove use of string module.
=== Zope3/lib/python/ZODB/MappingStorage.py 1.7 => 1.8 ===
"""
-import POSException, BaseStorage, string, utils
-from TimeStamp import TimeStamp
+import ZODB
+from ZODB import BaseStorage, POSException, utils
+from ZODB.TimeStamp import TimeStamp
+
+def DB(name="Mapping Storage",
+ pool_size=7, cache_size=400, cache_deactivate_after=60,
+ version_pool_size=3, version_cache_size=100,
+ version_cache_deactivate_after=10):
+ ms = MappingStorage(name)
+ db = ZODB.DB(ms, pool_size, cache_size, cache_deactivate_after,
+ version_pool_size, version_cache_size,
+ version_cache_deactivate_after)
+ return db
class MappingStorage(BaseStorage.BaseStorage):
@@ -194,4 +205,4 @@
o.append(' %s: %s, %s' %
(utils.u64(oid),TimeStamp(r[:8]),`r[8:]`))
- return string.join(o,'\n')
+ return "\n".join(o)