[Zope3-checkins] CVS: Zope3/lib/python/Zope/StartUp - SiteDefinition.py:1.3

Jeremy Hylton jeremy@zope.com
Thu, 18 Jul 2002 18:26:46 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/StartUp
In directory cvs.zope.org:/tmp/cvs-serv23291

Modified Files:
	SiteDefinition.py 
Log Message:
Use DB from storage.


=== Zope3/lib/python/Zope/StartUp/SiteDefinition.py 1.2 => 1.3 ===
 
 import asyncore, zLOG
 
-from ZODB import DB
-
-
 DEFAULT_STORAGE_FILE = 'Data.fs'
 DEFAULT_LOG_FILE = 'STDERR'
 DEFAULT_LOG_CLASS = 'Zope.Server.HTTPServer.CommonHitLogger'
@@ -72,15 +69,15 @@
 
     def useFileStorage(self, _context, file=DEFAULT_STORAGE_FILE):
         """Lets you specify the ZODB to use."""
-        from ZODB.FileStorage import FileStorage
-        self._zodb = DB(FileStorage(file))
+        from ZODB.FileStorage import DB
+        self._zodb = DB(file)
         return []
 
 
     def useMappingStorage(self, _context):
         """Lets you specify the ZODB to use."""
-        from ZODB.MappingStorage import MappingStorage
-        self._zodb = DB(MappingStorage(file))
+        from ZODB.MappingStorage import DB
+        self._zodb = DB(file)
         return []
 
 
@@ -132,10 +129,6 @@
         td = ThreadedTaskDispatcher()
         td.setThreadCount(self._threads)
         
-        # setup the storage, if not already done
-        if self._zodb is None:
-            self.useStorage(_context)
-        
         # check whether a root was already specified for this ZODB; if
         # not create one.
         self._initDB()
@@ -171,5 +164,5 @@
         "Handle empty/simple declaration."
         return [ Action(discriminator = 'Start Servers',
                         callable = self.start,
-                        args = (),
-                        ) ]    
+                        args = ()),
+                 ]