[Zodb-checkins] SVN: ZODB/trunk/src/Z Fixed various name errors
Jim Fulton
jim at zope.com
Wed Nov 19 18:25:50 EST 2008
Log message for revision 93150:
Fixed various name errors
(Thanks to Patrick Strawderman for pointing these out and providing
initial fixes.)
Changed:
U ZODB/trunk/src/ZEO/tests/InvalidationTests.py
U ZODB/trunk/src/ZEO/tests/testZEO.py
U ZODB/trunk/src/ZEO/zrpc/trigger.py
U ZODB/trunk/src/ZODB/FileStorage/fspack.py
U ZODB/trunk/src/ZODB/scripts/fsstats.py
U ZODB/trunk/src/ZODB/scripts/netspace.py
U ZODB/trunk/src/ZODB/scripts/stats.py
U ZODB/trunk/src/ZODB/tests/testFileStorage.py
-=-
Modified: ZODB/trunk/src/ZEO/tests/InvalidationTests.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/InvalidationTests.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZEO/tests/InvalidationTests.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -272,6 +272,9 @@
# the actual database state.
expected_keys = []
+ errormsgs = []
+ err = errormsgs.append
+
for t in threads:
if not t.added_keys:
err("thread %d didn't add any keys" % t.threadnum)
@@ -285,8 +288,6 @@
break
time.sleep(.1)
else:
- errormsgs = []
- err = errormsgs.append
err("expected keys != actual keys")
for k in expected_keys:
if k not in actual_keys:
Modified: ZODB/trunk/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZEO/tests/testZEO.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -46,6 +46,8 @@
from ZEO.ClientStorage import ClientStorage
+from ZEO.zrpc.error import DisconnectedError
+
import ZEO.zrpc.connection
from ZEO.tests import forker, Cache, CommitLockTests, ThreadTests, \
Modified: ZODB/trunk/src/ZEO/zrpc/trigger.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/trigger.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZEO/zrpc/trigger.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -152,6 +152,9 @@
# Windows version; uses just sockets, because a pipe isn't select'able
# on Windows.
+ class BindError(Exception):
+ pass
+
class trigger(_triggerbase, asyncore.dispatcher):
kind = "loopback"
Modified: ZODB/trunk/src/ZODB/FileStorage/fspack.py
===================================================================
--- ZODB/trunk/src/ZODB/FileStorage/fspack.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZODB/FileStorage/fspack.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -32,7 +32,14 @@
from ZODB.fsIndex import fsIndex
from ZODB.FileStorage.format import FileStorageFormatter, CorruptedDataError
from ZODB.FileStorage.format import DataHeader, TRANS_HDR_LEN
+import ZODB.POSException
+import logging
+logger = logging.getLogger(__name__)
+
+class PackError(ZODB.POSException.POSError):
+ pass
+
class PackCopier(FileStorageFormatter):
def __init__(self, f, index, tindex):
@@ -55,7 +62,7 @@
if stop_at_pack:
if h[16] == 'p':
break
- raise UndoError(None, "Invalid transaction id")
+ raise PackError("Invalid backpointer transaction id")
def _data_find(self, tpos, oid, data):
# Return backpointer for oid. Must call with the lock held.
@@ -84,7 +91,8 @@
if h.plen != len(data):
# The expected data doesn't match what's in the
# backpointer. Something is wrong.
- error("Mismatch between data and backpointer at %d", pos)
+ logger.error("Mismatch between data and backpointer at %d",
+ pos)
return 0
_data = self._file.read(h.plen)
if data != _data:
Modified: ZODB/trunk/src/ZODB/scripts/fsstats.py
===================================================================
--- ZODB/trunk/src/ZODB/scripts/fsstats.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZODB/scripts/fsstats.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -134,6 +134,7 @@
classes = {} # class -> list of oids
MAX = 0
+ objects = 0
tid = None
f = open(path, "rb")
Modified: ZODB/trunk/src/ZODB/scripts/netspace.py
===================================================================
--- ZODB/trunk/src/ZODB/scripts/netspace.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZODB/scripts/netspace.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -99,6 +99,9 @@
import sys
import getopt
+ global PACK
+ global VERBOSE
+
PACK = 0
VERBOSE = 0
try:
Modified: ZODB/trunk/src/ZODB/scripts/stats.py
===================================================================
--- ZODB/trunk/src/ZODB/scripts/stats.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZODB/scripts/stats.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -101,7 +101,7 @@
elif o == '-X':
heuristic = True
else:
- assert False, (o, opt)
+ assert False, (o, opts)
if len(args) != 1:
usage("exactly one file argument required")
Modified: ZODB/trunk/src/ZODB/tests/testFileStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testFileStorage.py 2008-11-19 23:25:48 UTC (rev 93149)
+++ ZODB/trunk/src/ZODB/tests/testFileStorage.py 2008-11-19 23:25:50 UTC (rev 93150)
@@ -356,7 +356,7 @@
lasttid = '\0' * 8
for txn in fs.iterator():
if lasttid >= txn.tid:
- raise ValueError("tids out of order %r >= %r" % (lasttid, tid))
+ raise ValueError("tids out of order %r >= %r" % (lasttid, txn.tid))
lasttid = txn.tid
# Return a TimeStamp object 'minutes' minutes in the future.
More information about the Zodb-checkins
mailing list