[Zope-Checkins] CVS: ZODB3/BDBStorage - BerkeleyBase.py:1.19.4.2

Barry Warsaw barry@wooz.org
Tue, 21 Jan 2003 17:31:21 -0500


Update of /cvs-repository/ZODB3/BDBStorage
In directory cvs.zope.org:/tmp/cvs-serv28667

Modified Files:
      Tag: ZODB3-3_1-branch
	BerkeleyBase.py 
Log Message:
Backporting of various changes from the 3.2 branch.  Specifically:

- get ZERO from the package


=== ZODB3/BDBStorage/BerkeleyBase.py 1.19.4.1 => 1.19.4.2 ===
--- ZODB3/BDBStorage/BerkeleyBase.py:1.19.4.1	Tue Jan  7 14:38:52 2003
+++ ZODB3/BDBStorage/BerkeleyBase.py	Tue Jan 21 17:31:18 2003
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# Copyright (c) 2001 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -13,8 +13,9 @@
 ##############################################################################
 
 """Base class for BerkeleyStorage implementations.
+
+$Revision$
 """
-__version__ = '$Revision$'.split()[-2:][0]
 
 import os
 import time
@@ -25,7 +26,7 @@
 
 # This uses the Dunn/Kuchling PyBSDDB v3 extension module available from
 # http://pybsddb.sourceforge.net
-from BDBStorage import db
+from BDBStorage import db, ZERO
 
 # BaseStorage provides primitives for lock acquisition and release, and a host
 # of other methods, some of which are overridden here, some of which are not.
@@ -289,7 +290,7 @@
         if value:
             self._oid = value[0]
         else:
-            self._oid = '\0\0\0\0\0\0\0\0'
+            self._oid = ZERO
 
     # It can be very expensive to calculate the "length" of the database, so
     # we cache the length and adjust it as we add and remove objects.
@@ -403,6 +404,7 @@
         self._env.close()
         os.unlink(lockfile)
 
+    # A couple of convenience methods
     def _update(self, deltas, data, incdec):
         refdoids = []
         referencesf(data, refdoids)