[Zodb-checkins] CVS: ZODB4/src/zodb - connection.py:1.14

Jeremy Hylton jeremy@zope.com
Thu, 6 Mar 2003 15:50:16 -0500


Update of /cvs-repository/ZODB4/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv19620/src/zodb

Modified Files:
	connection.py 
Log Message:
Get TmpStore closer to implementing IStorage.
Remove an unused import.


=== ZODB4/src/zodb/connection.py 1.13 => 1.14 ===
--- ZODB4/src/zodb/connection.py:1.13	Thu Mar  6 13:13:04 2003
+++ ZODB4/src/zodb/connection.py	Thu Mar  6 15:50:15 2003
@@ -40,7 +40,6 @@
 import cPickle
 from cStringIO import StringIO
 import logging
-import sys
 import tempfile
 import threading
 import time
@@ -51,6 +50,7 @@
 from zodb.export import ExportImport
 from zodb.interfaces import *
 from zodb.serialize import ConnectionObjectReader, ObjectWriter
+from zodb.storage.interfaces import IStorage
 from zodb.utils import p64, u64, Set, z64
 
 from transaction import get_transaction
@@ -76,7 +76,7 @@
         self._db = db
         self._storage = storage
         self._version = version
-        self._cache = cache = Cache(cache_size)
+        self._cache = Cache(cache_size)
         self._reader = ConnectionObjectReader(self, self._cache)
         self._log = logging.getLogger("zodb")
         # a TmpStore object used by sub-transactions
@@ -537,6 +537,9 @@
 
     _bver = ''
 
+    # XXX This storage doesn't implementation the full API yet
+    __implements__ = IStorage
+
     def __init__(self, base_version):
         self._transaction = None
         if base_version:
@@ -555,14 +558,8 @@
     def close(self):
         self._file.close()
 
-    def getName(self):
-        # XXX Is this a useful method?
-        return self._storage.getName()
-
-    def getSize(self):
-        return self._pos
-
     def load(self, oid, version):
+        # XXX I don't think the version handling is correct here.
         pos = self._index.get(oid, None)
         if pos is None:
             return self._storage.load(oid, self._bver)