Commit f1b04dd8 authored by Jim Fulton's avatar Jim Fulton
parent 5c019378
......@@ -13,7 +13,6 @@
##############################################################################
"""RPC stubs for interface exported by StorageServer."""
import os
import time
from ZODB.utils import z64
......
......@@ -26,7 +26,6 @@ from ZEO.Exceptions import AuthError
from ZEO.monitor import StorageStats, StatsServer
from ZEO.zrpc.connection import ManagedServerConnection, Delay, MTDelay, Result
from ZEO.zrpc.server import Dispatcher
from ZEO.zrpc.trigger import trigger
from ZODB.ConflictResolution import ResolvedSerial
from ZODB.loglevels import BLATHER
from ZODB.POSException import StorageError, StorageTransactionError
......
......@@ -16,8 +16,6 @@
in favor of using hashlib for both. This class allows for compatibility
between versions."""
import sys
try:
import hashlib
sha1 = hashlib.sha1
......
......@@ -22,8 +22,6 @@ import time
import types
import logging
import ZEO
zeo_version = 'unknown'
try:
import pkg_resources
......
......@@ -41,7 +41,7 @@ import signal
import socket
import logging
import ZConfig, ZConfig.datatypes
import ZConfig.datatypes
import ZEO
from zdaemon.zdoptions import ZDOptions
......
......@@ -33,11 +33,9 @@ Note:
import bisect
import getopt
import math
import struct
import re
import sys
import time
import ZEO.cache
from ZODB.utils import z64, u64
......
......@@ -13,9 +13,7 @@
##############################################################################
import os
import sys
import time
import random
import socket
import asyncore
import threading
......
......@@ -15,7 +15,6 @@
"""Test suite for ZEO.runzeo.ZEOOptions."""
import os
import sys
import tempfile
import unittest
......
......@@ -16,7 +16,6 @@
from ZODB.utils import p64, repr_to_oid
import doctest
import os
import random
import string
import struct
import sys
......
......@@ -19,9 +19,7 @@ import socket
import sys
import threading
import time
import traceback
import types
import logging
import ZEO.zrpc.trigger
......
......@@ -12,17 +12,11 @@
#
##############################################################################
import asyncore
import atexit
import cPickle
import errno
import select
import sys
import threading
import logging
import ZEO.zrpc.marshal
import traceback, time
import ZEO.zrpc.trigger
from ZEO.zrpc import smac
......
......@@ -21,7 +21,6 @@ import tempfile
import threading
import warnings
import os
import shutil
import time
from persistent import PickleCache
......@@ -48,7 +47,7 @@ from ZODB.POSException import InvalidObjectReference, ConnectionStateError
from ZODB.POSException import ConflictError, ReadConflictError
from ZODB.POSException import Unsupported, ReadOnlyHistoryError
from ZODB.POSException import POSKeyError
from ZODB.serialize import ObjectWriter, ObjectReader, myhasattr
from ZODB.serialize import ObjectWriter, ObjectReader
from ZODB.utils import p64, u64, z64, oid_repr, positive_id
from ZODB import utils
......
......@@ -20,7 +20,6 @@ import sys
import threading
import logging
import datetime
import calendar
import time
import warnings
......
......@@ -22,7 +22,7 @@ import logging
from ZODB.blob import Blob
from ZODB.interfaces import IBlobStorage
from ZODB.POSException import ExportError, POSKeyError
from ZODB.POSException import ExportError
from ZODB.serialize import referencesf
from ZODB.utils import p64, u64, cp, mktemp
......@@ -58,14 +58,14 @@ class ExportImport:
if supports_blobs:
if not isinstance(self._reader.getGhost(p), Blob):
continue # not a blob
blobfilename = self._storage.loadBlob(oid, serial)
f.write(blob_begin_marker)
f.write(p64(os.stat(blobfilename).st_size))
blobdata = open(blobfilename, "rb")
cp(blobdata, f)
blobdata.close()
f.write(export_end_marker)
return f
......@@ -177,7 +177,7 @@ class ExportImport:
data = newp.getvalue()
if blob_filename is not None:
self._storage.storeBlob(oid, None, data, blob_filename,
self._storage.storeBlob(oid, None, data, blob_filename,
'', transaction)
else:
self._storage.store(oid, None, data, '', transaction)
......
......@@ -31,7 +31,6 @@ from ZODB.POSException import UndoError, POSKeyError, MultipleUndoErrors
from ZODB.utils import p64, u64, z64
import base64
import BTrees.OOBTree
import contextlib
import errno
import logging
......
......@@ -18,7 +18,6 @@ from ZODB.FileStorage.format import TRANS_HDR, TRANS_HDR_LEN
from ZODB.FileStorage.format import DATA_HDR, DATA_HDR_LEN
from ZODB.TimeStamp import TimeStamp
from ZODB.utils import u64, get_pickle_metadata
from ZODB.tests.StorageTestBase import zodb_unpickle
def fsdump(path, file=None, with_offset=1):
iter = FileIterator(path)
......
......@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import cPickle
import doctest
import os
import time
......
......@@ -18,7 +18,6 @@ storage without distracting storage details.
"""
import BTrees
import cPickle
import time
import threading
import ZODB.BaseStorage
......
......@@ -3,7 +3,6 @@
# Based on a transaction analyzer by Matt Kromer.
import pickle
import re
import sys
import types
from ZODB.FileStorage import FileStorage
......
......@@ -4,10 +4,8 @@ Note: To run this test script fstest.py must be on your PYTHONPATH.
"""
from cStringIO import StringIO
import os
import re
import struct
import tempfile
import unittest
import ZODB.tests.util
......
......@@ -19,8 +19,8 @@ import optparse
import os
import shutil
from ZODB.blob import FilesystemHelper, rename_or_copy_blob
from ZODB.utils import cp, oid_repr
from ZODB.blob import FilesystemHelper
from ZODB.utils import oid_repr
def link_or_copy(f1, f2):
......@@ -34,7 +34,7 @@ try:
os.link
except AttributeError:
link_or_copy = shutil.copy
def migrate(source, dest, layout):
source_fsh = FilesystemHelper(source)
......
......@@ -25,6 +25,3 @@ def referrers(storage):
for oid in referencesf(record.data):
result.setdefault(oid, []).append((record.oid, record.tid))
return result
......@@ -17,7 +17,7 @@ import os
import random
import stat
import ZODB, ZODB.FileStorage
import ZODB.FileStorage
from StorageTestBase import StorageTestBase
class FileStorageCorruptTests(StorageTestBase):
......
......@@ -18,7 +18,6 @@ all these tests.
"""
from ZODB.tests.MinPO import MinPO
from transaction import Transaction
class HistoryStorage:
def checkSimpleHistory(self):
......@@ -59,4 +58,4 @@ class HistoryStorage:
eq(d['tid'], revid2)
d = h[2]
eq(d['tid'], revid1)
......@@ -17,14 +17,10 @@ Each Connection has its own view of the database. Polling updates each
connection's view.
"""
import time
import BTrees
import ZODB.utils
import ZODB.POSException
from ZODB.interfaces import IMVCCStorage
from ZODB.MappingStorage import MappingStorage
from ZODB.TimeStamp import TimeStamp
from zope.interface import implements
......
......@@ -16,7 +16,7 @@
import transaction
from transaction import Transaction
from ZODB.tests.IteratorStorage import IteratorDeepCompare
from ZODB.tests.StorageTestBase import MinPO, zodb_unpickle, snooze
from ZODB.tests.StorageTestBase import MinPO, snooze
from ZODB import DB
from ZODB.serialize import referencesf
......
......@@ -27,7 +27,6 @@ import doctest
import gc
import sys
import threading
import time
import transaction
import unittest
import ZODB
......
......@@ -17,13 +17,11 @@ from __future__ import with_statement
import doctest
import unittest
import warnings
from persistent import Persistent
import transaction
from ZODB.config import databaseFromString
from ZODB.utils import p64, u64
from ZODB.tests.warnhook import WarningsHook
from ZODB.utils import p64
from zope.interface.verify import verifyObject
import ZODB.tests.util
......
......@@ -13,7 +13,6 @@
##############################################################################
from ZODB.tests.MinPO import MinPO
import datetime
import doctest
import os
import sys
......@@ -60,7 +59,7 @@ class DBTests(ZODB.tests.util.TestCase):
def test_references(self):
# TODO: For now test that we're using referencesf. We really should
# have tests of referencesf.
# have tests of referencesf.
import ZODB.serialize
self.assert_(self.db.references is ZODB.serialize.referencesf)
......
......@@ -14,13 +14,11 @@
from persistent import Persistent
from persistent.mapping import PersistentMapping
from ZODB.POSException import ReadConflictError, ConflictError
from ZODB.POSException import ReadConflictError
from ZODB.POSException import TransactionFailedError
from ZODB.tests.warnhook import WarningsHook
import transaction
import unittest
import warnings
import ZODB
import ZODB.FileStorage
import ZODB.MappingStorage
......
......@@ -21,7 +21,6 @@ storage tests against the test storage.
from __future__ import with_statement
import bisect
import threading
import unittest
from ZODB.BaseStorage import BaseStorage
......@@ -30,7 +29,7 @@ from ZODB.utils import z64
from ZODB.tests import StorageTestBase
from ZODB.tests import BasicStorage, MTStorage, Synchronization
from ZODB.tests import PackableStorage, RevisionStorage
from ZODB.tests import RevisionStorage
class Transaction(object):
"""Hold data for current transaction for MinimalMemoryStorage."""
......
......@@ -15,7 +15,6 @@ import manuel.doctest
import manuel.footnote
import manuel.capture
import manuel.testing
import unittest
import ZODB.ConflictResolution
import ZODB.tests.util
import zope.testing.module
......
......@@ -12,7 +12,6 @@
#
##############################################################################
import doctest
import os
import sys
import transaction
import unittest
......
......@@ -20,16 +20,15 @@ from ZODB.MappingStorage import DB
import atexit
import os
import tempfile
import time
import unittest
import persistent
import sys
import tempfile
import time
import transaction
import unittest
import warnings
import zope.testing.setupstack
import ZODB.utils
import zope.testing.setupstack
def setUp(test, name='test'):
transaction.abort()
......
......@@ -19,7 +19,6 @@ from struct import pack, unpack
from binascii import hexlify, unhexlify
import cPickle as pickle
from cStringIO import StringIO
import weakref
import warnings
from tempfile import mkstemp
import os
......
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