[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup - datatypes.py:1.12
Shane Hathaway
shane@zope.com
Sat, 2 Aug 2003 12:58:36 -0400
Update of /cvs-repository/Zope/lib/python/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv516
Modified Files:
datatypes.py
Log Message:
Made it possible to use a different DB class by extending ZopeDatabase.
Also set the connection class only when specified.
=== Zope/lib/python/Zope/Startup/datatypes.py 1.11 => 1.12 ===
--- Zope/lib/python/Zope/Startup/datatypes.py:1.11 Sun Jul 20 22:21:03 2003
+++ Zope/lib/python/Zope/Startup/datatypes.py Sat Aug 2 12:58:31 2003
@@ -158,10 +158,15 @@
container_class = 'OFS.Folder.Folder'
+ def createDB(self):
+ return ZODBDatabase.open(self)
+
def open(self):
- DB = ZODBDatabase.open(self)
- # set the connection class
- DB.klass = self.config.connection_class
+ DB = self.createDB()
+ if self.config.connection_class:
+ # set the connection class
+ DB.klass = self.config.connection_class
+ print DB, DB.klass
if self.config.class_factory is not None:
DB.setClassFactory(self.config.class_factory)
from ZODB.ActivityMonitor import ActivityMonitor