Commit 8ed8aa60 authored by Dmitry Vasiliev's avatar Dmitry Vasiliev

Merge rev 28197 from ZODB 3.3 branch.

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