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