Commit ca9cfcf9 authored by Dmitry Vasiliev's avatar Dmitry Vasiliev

Merge rev 28197 from ZODB 3.3 branch.

Imports normalization.
parent db606bfc
...@@ -20,12 +20,10 @@ import threading ...@@ -20,12 +20,10 @@ import threading
import time import time
import logging import logging
import UndoLogCompatible
import POSException
from persistent.TimeStamp import TimeStamp from persistent.TimeStamp import TimeStamp
from ZODB import POSException, utils from ZODB import POSException
from ZODB.utils import z64 from ZODB.utils import z64, oid_repr
from ZODB.UndoLogCompatible import UndoLogCompatible from ZODB.UndoLogCompatible import UndoLogCompatible
log = logging.getLogger("ZODB.BaseStorage") log = logging.getLogger("ZODB.BaseStorage")
...@@ -402,7 +400,7 @@ class BaseStorage(UndoLogCompatible): ...@@ -402,7 +400,7 @@ class BaseStorage(UndoLogCompatible):
for r in transaction: for r in transaction:
oid=r.oid oid=r.oid
if verbose: if verbose:
print utils.oid_repr(oid), r.version, len(r.data) print oid_repr(oid), r.version, len(r.data)
if restoring: if restoring:
self.restore(oid, r.tid, r.data, r.version, self.restore(oid, r.tid, r.data, r.version,
r.data_txn, transaction) r.data_txn, transaction)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
import sys
import logging import logging
from cStringIO import StringIO from cStringIO import StringIO
from cPickle import Unpickler, Pickler from cPickle import Unpickler, Pickler
......
...@@ -20,10 +20,8 @@ import sys ...@@ -20,10 +20,8 @@ import sys
import threading import threading
import warnings import warnings
from time import time from time import time
from utils import u64
from persistent import PickleCache from persistent import PickleCache
from persistent.interfaces import IPersistent
import transaction import transaction
...@@ -33,7 +31,7 @@ from ZODB.POSException \ ...@@ -33,7 +31,7 @@ from ZODB.POSException \
import ConflictError, ReadConflictError, InvalidObjectReference, \ import ConflictError, ReadConflictError, InvalidObjectReference, \
ConnectionStateError ConnectionStateError
from ZODB.TmpStore import TmpStore from ZODB.TmpStore import TmpStore
from ZODB.utils import oid_repr, z64, positive_id from ZODB.utils import u64, oid_repr, z64, positive_id
from ZODB.serialize import ObjectWriter, ConnectionObjectReader, myhasattr from ZODB.serialize import ObjectWriter, ConnectionObjectReader, myhasattr
from ZODB.interfaces import IConnection from ZODB.interfaces import IConnection
from zope.interface import implements from zope.interface import implements
......
...@@ -80,9 +80,9 @@ and call it to monitor the storage. ...@@ -80,9 +80,9 @@ and call it to monitor the storage.
""" """
import base64, time, string import base64, time
from ZODB import POSException, BaseStorage, utils from ZODB import POSException, BaseStorage
from ZODB.utils import z64 from ZODB.utils import z64, oid_repr
from persistent.TimeStamp import TimeStamp from persistent.TimeStamp import TimeStamp
from cPickle import loads from cPickle import loads
from BTrees import OOBTree from BTrees import OOBTree
...@@ -509,8 +509,8 @@ class DemoStorage(BaseStorage.BaseStorage): ...@@ -509,8 +509,8 @@ class DemoStorage(BaseStorage.BaseStorage):
o.append(" %s %s" % (TimeStamp(tid), p)) o.append(" %s %s" % (TimeStamp(tid), p))
for r in t: for r in t:
oid, pre, vdata, p, tid = r oid, pre, vdata, p, tid = r
oid = utils.oid_repr(oid) oid = oid_repr(oid)
tid = utils.oid_repr(tid) tid = oid_repr(tid)
## if serial is not None: serial=str(TimeStamp(serial)) ## if serial is not None: serial=str(TimeStamp(serial))
pre=id(pre) pre=id(pre)
if vdata and vdata[1]: vdata=vdata[0], id(vdata[1]) if vdata and vdata[1]: vdata=vdata[0], id(vdata[1])
...@@ -523,7 +523,7 @@ class DemoStorage(BaseStorage.BaseStorage): ...@@ -523,7 +523,7 @@ class DemoStorage(BaseStorage.BaseStorage):
items.sort() items.sort()
for oid, r in items: for oid, r in items:
if r: r=id(r) if r: r=id(r)
o.append(' %s: %s' % (utils.oid_repr(oid), r)) o.append(' %s: %s' % (oid_repr(oid), r))
o.append('\nVersion Index:') o.append('\nVersion Index:')
items=self._vindex.items() items=self._vindex.items()
...@@ -534,6 +534,6 @@ class DemoStorage(BaseStorage.BaseStorage): ...@@ -534,6 +534,6 @@ class DemoStorage(BaseStorage.BaseStorage):
vitems.sort() vitems.sort()
for oid, r in vitems: for oid, r in vitems:
if r: r=id(r) if r: r=id(r)
o.append(' %s: %s' % (utils.oid_repr(oid), r)) o.append(' %s: %s' % (oid_repr(oid), r))
return string.join(o,'\n') return '\n'.join(o)
...@@ -21,7 +21,6 @@ import logging ...@@ -21,7 +21,6 @@ import logging
from ZODB.POSException import ExportError from ZODB.POSException import ExportError
from ZODB.utils import p64, u64 from ZODB.utils import p64, u64
from ZODB.serialize import referencesf from ZODB.serialize import referencesf
import sys
logger = logging.getLogger('ZODB.ExportImport') logger = logging.getLogger('ZODB.ExportImport')
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
$Id$""" $Id$"""
import string
import time import time
import sys
import thread import thread
import logging import logging
import persistent import persistent
...@@ -187,7 +185,7 @@ class MountPoint(persistent.Persistent, Acquisition.Implicit): ...@@ -187,7 +185,7 @@ class MountPoint(persistent.Persistent, Acquisition.Implicit):
if newMount: if newMount:
try: id = data.getId() try: id = data.getId()
except: id = '???' # data has no getId() method. Bad. except: id = '???' # data has no getId() method. Bad.
p = string.join(parent.getPhysicalPath() + (id,), '/') p = '/'.join(parent.getPhysicalPath() + (id,))
logger.info('Mounted database %s at %s', logger.info('Mounted database %s at %s',
self._getMountParams(), p) self._getMountParams(), p)
else: else:
......
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