[Zope3-checkins] CVS: Zope3/src/ZODB - Connection.py:1.136 DB.py:1.70 Mount.py:1.23

Jim Fulton jim at zope.com
Thu Mar 4 17:42:22 EST 2004


Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv3962/src/ZODB

Modified Files:
	Connection.py DB.py Mount.py 
Log Message:
Renamed the _classFactory attribute to classFactory.


=== Zope3/src/ZODB/Connection.py 1.135 => 1.136 ===
--- Zope3/src/ZODB/Connection.py:1.135	Thu Mar  4 14:48:03 2004
+++ Zope3/src/ZODB/Connection.py	Thu Mar  4 17:41:50 2004
@@ -348,7 +348,7 @@
         else:
             self._flush_invalidations()
         self._reader = ConnectionObjectReader(self, self._cache,
-                                              self._db._classFactory)
+                                              self._db.classFactory)
         self._opened = time()
 
     def _resetCache(self):


=== Zope3/src/ZODB/DB.py 1.69 => 1.70 ===
--- Zope3/src/ZODB/DB.py:1.69	Thu Mar  4 14:48:04 2004
+++ Zope3/src/ZODB/DB.py	Thu Mar  4 17:41:50 2004
@@ -45,9 +45,8 @@
     it to provide a different connection implementation.
 
     The database provides a few methods intended for application code
-    -- open, close, undo, pack, setClassFactory -- and a large
-    collection of methods for inspecting the database and its connections'
-    caches.
+    -- open, close, undo, and pack -- and a large collection of
+    methods for inspecting the database and its connections' caches.
     """
     
     klass = Connection  # Class to use for connections
@@ -142,9 +141,6 @@
         else: m=None
         return m
 
-    def _classFactory(self, connection, modulename, globalname):
-        return find_global(modulename, globalname)
-
     def _closeConnection(self, connection):
         """Return a connection to the pool"""
         self._a()
@@ -574,19 +570,8 @@
             for c in pool_info[1]:
                 c._cache.cache_size = v
 
-    def setClassFactory(self, factory):
-        """Override default mechanism for loading object classes.
-
-        The database stores objects, but uses Python's standard import
-        to load the code for those objects.  The class factory is used
-        by the database serialization layer to find the classes.  It
-        uses ZODB.broken.find_global by default.
-
-        This method can be used to override the default class loading
-        code.  See ZODB.broken.find_global for details
-        about the contract of factory.
-        """
-        self._classFactory = factory
+    def classFactory(self, connection, modulename, globalname):
+        return find_global(modulename, globalname)
 
     def setPoolSize(self, v):
         self._pool_size=v


=== Zope3/src/ZODB/Mount.py 1.22 => 1.23 ===
--- Zope3/src/ZODB/Mount.py:1.22	Thu Feb 26 19:31:53 2004
+++ Zope3/src/ZODB/Mount.py	Thu Mar  4 17:41:50 2004
@@ -41,7 +41,7 @@
         return getattr(__import__(
             module, _globals, _globals, _silly), name)
     else:
-        return parent_db._classFactory(parent_conn, module, name)
+        return parent_db.classFactory(parent_conn, module, name)
 
 
 class MountPoint(persistent.Persistent, Acquisition.Implicit):
@@ -105,7 +105,7 @@
                 dbs[params] = (db, {self.__mountpoint_id:1})
 
                 if getattr(self, '_classDefsFromRoot', 1):
-                    db.setClassFactory(parentClassFactory)
+                    db.classFactory = parentClassFactory
             else:
                 db, mounts = dbInfo
                 # Be sure this object is in the list of mount points.




More information about the Zope3-Checkins mailing list