[Zope-Checkins] CVS: ZODB3/ZODB/FileStorage - FileStorage.py:1.1.2.8

Jeremy Hylton cvs-admin at zope.org
Wed Nov 12 12:26:21 EST 2003


Update of /cvs-repository/ZODB3/ZODB/FileStorage
In directory cvs.zope.org:/tmp/cvs-serv2408/ZODB/FileStorage

Modified Files:
      Tag: ZODB3-mvcc-2-branch
	FileStorage.py 
Log Message:
A few small revisions.

Make more use of _lookup_pos().
Comment on the non-functional loadNonCurrent().
Tweak dict assignments.


=== ZODB3/ZODB/FileStorage/FileStorage.py 1.1.2.7 => 1.1.2.8 ===
--- ZODB3/ZODB/FileStorage/FileStorage.py:1.1.2.7	Wed Nov 12 00:23:49 2003
+++ ZODB3/ZODB/FileStorage/FileStorage.py	Wed Nov 12 12:26:20 2003
@@ -590,18 +590,13 @@
         finally:
             self._lock_release()
 
-    def loadNonCurrent(self, oid, tid):
-        pass
+##    def loadNonCurrent(self, oid, tid):
+##        pass
 
     def modifiedInVersion(self, oid):
         self._lock_acquire()
         try:
-            try:
-                pos = self._index[oid]
-            except KeyError:
-                raise POSKeyError(oid)
-            except TypeError:
-                raise TypeError, 'invalid oid %r' % (oid,)
+            pos = self._lookup_pos(oid)
             h = self._read_data_header(pos, oid)
             return h.version
         finally:
@@ -1219,14 +1214,9 @@
     def history(self, oid, version=None, size=1, filter=None):
         self._lock_acquire()
         try:
-            r=[]
-            try:
-                pos=self._index[oid]
-            except KeyError:
-                raise POSKeyError(oid)
-            except TypeError:
-                raise TypeError, 'invalid oid %r' % (oid,)
-            wantver=version
+            r = []
+            pos = self._lookup_pos(oid)
+            wantver = version
 
             while 1:
                 if len(r) >= size: return r
@@ -1251,12 +1241,13 @@
                 else:
                     d = {}
 
-                d["time"] = TimeStamp(h.serial).timeTime()
-                d["user_name"] = user_name
-                d["description"] = description
-                d["serial"] = h.serial
-                d["version"] = h.version
-                d["size"] = h.plen
+                d.update({"time": TimeStamp(h.serial).timeTime(),
+                          "user_name": user_name,
+                          "description": description,
+                          "serial": h.serial,
+                          "version": h.version,
+                          "size": h.plen,
+                          })
 
                 if filter is None or filter(d):
                     r.append(d)




More information about the Zope-Checkins mailing list