Commit adf92861 authored by Tres Seaver's avatar Tres Seaver

Merge pull request #25 from navytux/fixup

Small fixups while learning ZODB
parents db0eb296 eda11559
...@@ -70,8 +70,6 @@ from ZODB.utils import u64, oid_repr, get_pickle_metadata ...@@ -70,8 +70,6 @@ from ZODB.utils import u64, oid_repr, get_pickle_metadata
from ZODB.serialize import get_refs from ZODB.serialize import get_refs
from ZODB.POSException import POSKeyError from ZODB.POSException import POSKeyError
VERBOSE = 0
# There's a problem with oid. 'data' is its pickle, and 'serial' its # There's a problem with oid. 'data' is its pickle, and 'serial' its
# serial number. 'missing' is a list of (oid, class, reason) triples, # serial number. 'missing' is a list of (oid, class, reason) triples,
# explaining what the problem(s) is(are). # explaining what the problem(s) is(are).
...@@ -94,6 +92,7 @@ def report(oid, data, serial, missing): ...@@ -94,6 +92,7 @@ def report(oid, data, serial, missing):
print() print()
def main(path=None): def main(path=None):
verbose = 0
if path is None: if path is None:
import sys import sys
import getopt import getopt
...@@ -101,7 +100,7 @@ def main(path=None): ...@@ -101,7 +100,7 @@ def main(path=None):
opts, args = getopt.getopt(sys.argv[1:], "v") opts, args = getopt.getopt(sys.argv[1:], "v")
for k, v in opts: for k, v in opts:
if k == "-v": if k == "-v":
VERBOSE += 1 verbose += 1
path, = args path, = args
...@@ -127,7 +126,7 @@ def main(path=None): ...@@ -127,7 +126,7 @@ def main(path=None):
except POSKeyError: except POSKeyError:
undone[oid] = 1 undone[oid] = 1
except: except:
if VERBOSE: if verbose:
traceback.print_exc() traceback.print_exc()
noload[oid] = 1 noload[oid] = 1
......
...@@ -10,7 +10,7 @@ from __future__ import print_function ...@@ -10,7 +10,7 @@ from __future__ import print_function
import ZODB import ZODB
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
from ZODB.utils import U64, get_pickle_metadata from ZODB.utils import U64, get_pickle_metadata
from ZODB.referencesf import referencesf from ZODB.serialize import referencesf
from six.moves import filter from six.moves import filter
def find_paths(root, maxdist): def find_paths(root, maxdist):
......
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