Commit 02a03c4d authored by Barry Warsaw's avatar Barry Warsaw

Get ZERO from the package.

Remove __version__
parent 816d3ea3
############################################################################## ##############################################################################
# #
# Copyright (c) 2001, 2002 Zope Corporation and Contributors. # Copyright (c) 2001 Zope Corporation and Contributors.
# All Rights Reserved. # All Rights Reserved.
# #
# This software is subject to the provisions of the Zope Public License, # This software is subject to the provisions of the Zope Public License,
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
"""Base class for BerkeleyStorage implementations. """Base class for BerkeleyStorage implementations.
""" """
__version__ = '$Revision: 1.38 $'.split()[-2:][0]
import os import os
import time import time
...@@ -25,7 +24,7 @@ from types import StringType ...@@ -25,7 +24,7 @@ from types import StringType
# This uses the Dunn/Kuchling PyBSDDB v3 extension module available from # This uses the Dunn/Kuchling PyBSDDB v3 extension module available from
# http://pybsddb.sourceforge.net # http://pybsddb.sourceforge.net
from BDBStorage import db from BDBStorage import db, ZERO
# BaseStorage provides primitives for lock acquisition and release, and a host # 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. # of other methods, some of which are overridden here, some of which are not.
...@@ -289,7 +288,7 @@ class BerkeleyBase(BaseStorage): ...@@ -289,7 +288,7 @@ class BerkeleyBase(BaseStorage):
if value: if value:
self._oid = value[0] self._oid = value[0]
else: 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 # 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. # we cache the length and adjust it as we add and remove objects.
...@@ -403,6 +402,7 @@ class BerkeleyBase(BaseStorage): ...@@ -403,6 +402,7 @@ class BerkeleyBase(BaseStorage):
self._env.close() self._env.close()
os.unlink(lockfile) os.unlink(lockfile)
# A couple of convenience methods
def _update(self, deltas, data, incdec): def _update(self, deltas, data, incdec):
refdoids = [] refdoids = []
referencesf(data, refdoids) referencesf(data, refdoids)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment