Commit 3b5a6edb authored by Julien Muchembled's avatar Julien Muchembled

Remove unused imports, found by pylint

parent e0a2a217
...@@ -22,8 +22,7 @@ from .handler import AdminEventHandler, MasterEventHandler, \ ...@@ -22,8 +22,7 @@ from .handler import AdminEventHandler, MasterEventHandler, \
MasterRequestEventHandler MasterRequestEventHandler
from neo.lib.bootstrap import BootstrapManager from neo.lib.bootstrap import BootstrapManager
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.protocol import ClusterStates, Errors, \ from neo.lib.protocol import ClusterStates, Errors, NodeTypes, Packets
NodeTypes, NodeStates, Packets
from neo.lib.debug import register as registerLiveDebugger from neo.lib.debug import register as registerLiveDebugger
class Application(BaseApplication): class Application(BaseApplication):
......
...@@ -18,7 +18,6 @@ from ZODB import BaseStorage, ConflictResolution, POSException ...@@ -18,7 +18,6 @@ from ZODB import BaseStorage, ConflictResolution, POSException
from zope.interface import implementer from zope.interface import implementer
import ZODB.interfaces import ZODB.interfaces
from functools import wraps
from neo.lib import logging from neo.lib import logging
from .app import Application from .app import Application
from .exception import NEOStorageNotFoundError, NEOStorageDoesNotExistError from .exception import NEOStorageNotFoundError, NEOStorageDoesNotExistError
......
...@@ -19,7 +19,6 @@ from zlib import compress, decompress ...@@ -19,7 +19,6 @@ from zlib import compress, decompress
from random import shuffle from random import shuffle
import heapq import heapq
import time import time
import weakref
from functools import partial from functools import partial
from ZODB.POSException import UndoError, StorageTransactionError, ConflictError from ZODB.POSException import UndoError, StorageTransactionError, ConflictError
...@@ -32,20 +31,17 @@ from persistent.TimeStamp import TimeStamp ...@@ -32,20 +31,17 @@ from persistent.TimeStamp import TimeStamp
from neo.lib import logging from neo.lib import logging
from neo.lib.protocol import NodeTypes, Packets, \ from neo.lib.protocol import NodeTypes, Packets, \
INVALID_PARTITION, MAX_TID, ZERO_HASH, ZERO_TID INVALID_PARTITION, MAX_TID, ZERO_HASH, ZERO_TID
from neo.lib.event import EventManager
from neo.lib.util import makeChecksum, dump from neo.lib.util import makeChecksum, dump
from neo.lib.locking import Empty, Lock, SimpleQueue from neo.lib.locking import Empty, Lock, SimpleQueue
from neo.lib.connection import MTClientConnection, ConnectionClosed from neo.lib.connection import MTClientConnection, ConnectionClosed
from neo.lib.node import NodeManager
from .exception import NEOStorageError, NEOStorageCreationUndoneError from .exception import NEOStorageError, NEOStorageCreationUndoneError
from .exception import NEOStorageNotFoundError from .exception import NEOStorageNotFoundError
from .handlers import storage, master from .handlers import storage, master
from neo.lib.dispatcher import Dispatcher, ForgottenPacket from neo.lib.dispatcher import ForgottenPacket
from neo.lib.threaded_app import ThreadedApplication from neo.lib.threaded_app import ThreadedApplication
from .cache import ClientCache from .cache import ClientCache
from .pool import ConnectionPool from .pool import ConnectionPool
from neo.lib.util import p64, u64, parseMasterList from neo.lib.util import p64, u64, parseMasterList
from neo.lib.debug import register as registerLiveDebugger
CHECKED_SERIAL = object() CHECKED_SERIAL = object()
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
from neo.lib import logging from neo.lib import logging
from neo.lib.handler import MTEventHandler from neo.lib.handler import MTEventHandler
from neo.lib.pt import MTPartitionTable as PartitionTable from neo.lib.pt import MTPartitionTable as PartitionTable
from neo.lib.protocol import NodeStates, Packets, ProtocolError from neo.lib.protocol import NodeStates, ProtocolError
from neo.lib.util import dump, add64 from neo.lib.util import dump
from . import AnswerBaseHandler from . import AnswerBaseHandler
from ..exception import NEOStorageError from ..exception import NEOStorageError
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import inspect import inspect
from functools import wraps
def check_signature(reference, function): def check_signature(reference, function):
# args, varargs, varkw, defaults # args, varargs, varkw, defaults
......
...@@ -21,7 +21,6 @@ from .connection import ConnectionClosed ...@@ -21,7 +21,6 @@ from .connection import ConnectionClosed
from .debug import register as registerLiveDebugger from .debug import register as registerLiveDebugger
from .dispatcher import Dispatcher, ForgottenPacket from .dispatcher import Dispatcher, ForgottenPacket
from .locking import SimpleQueue from .locking import SimpleQueue
from .protocol import Packets
class app_set(weakref.WeakSet): class app_set(weakref.WeakSet):
......
...@@ -22,8 +22,8 @@ from neo.lib.bootstrap import BootstrapManager ...@@ -22,8 +22,8 @@ from neo.lib.bootstrap import BootstrapManager
from neo.lib.exception import PrimaryFailure from neo.lib.exception import PrimaryFailure
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.protocol import CellStates, ClusterStates, \ from neo.lib.protocol import ClusterStates, \
NodeStates, NodeTypes, Packets, uuid_str, INVALID_TID, ZERO_TID NodeTypes, Packets, uuid_str, ZERO_TID
from neo.lib.util import add64, dump from neo.lib.util import add64, dump
from .app import StateChangedException from .app import StateChangedException
from .pt import PartitionTable from .pt import PartitionTable
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
from collections import defaultdict from collections import defaultdict
from neo.lib import logging from neo.lib import logging
from neo.lib.util import dump
from neo.lib.protocol import ClusterStates, Packets, NodeStates from neo.lib.protocol import ClusterStates, Packets, NodeStates
from .handlers import BaseServiceHandler from .handlers import BaseServiceHandler
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import traceback import traceback
import unittest import unittest
import logging
import time import time
import sys import sys
import os import os
...@@ -33,7 +32,6 @@ if filter(re.compile(r'--coverage$|-\w*c').match, sys.argv[1:]): ...@@ -33,7 +32,6 @@ if filter(re.compile(r'--coverage$|-\w*c').match, sys.argv[1:]):
coverage.neotestrunner = [] coverage.neotestrunner = []
coverage.start() coverage.start()
import neo
from neo.tests import getTempDirectory, __dict__ as neo_tests__dict__ from neo.tests import getTempDirectory, __dict__ as neo_tests__dict__
from neo.tests.benchmark import BenchmarkRunner from neo.tests.benchmark import BenchmarkRunner
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import inspect, random, signal, sys import inspect, random
from logging import getLogger, INFO from logging import getLogger, INFO
from optparse import OptionParser from optparse import OptionParser
from neo.lib import logging from neo.lib import logging
......
...@@ -21,7 +21,6 @@ from neo.lib import logging ...@@ -21,7 +21,6 @@ from neo.lib import logging
from neo.lib.app import BaseApplication from neo.lib.app import BaseApplication
from neo.lib.protocol import uuid_str, \ from neo.lib.protocol import uuid_str, \
CellStates, ClusterStates, NodeTypes, Packets CellStates, ClusterStates, NodeTypes, Packets
from neo.lib.node import NodeManager
from neo.lib.connection import ListeningConnection from neo.lib.connection import ListeningConnection
from neo.lib.exception import StoppedOperation, PrimaryFailure from neo.lib.exception import StoppedOperation, PrimaryFailure
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
......
...@@ -28,8 +28,7 @@ from .manager import DatabaseManager ...@@ -28,8 +28,7 @@ from .manager import DatabaseManager
from neo.lib import logging, patch, util from neo.lib import logging, patch, util
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.lib.interfaces import implements from neo.lib.interfaces import implements
from neo.lib.protocol import BackendNotImplemented, CellStates, \ from neo.lib.protocol import BackendNotImplemented, MAX_TID
MAX_TID, ZERO_HASH, ZERO_OID, ZERO_TID
patch.speedupFileStorageTxnLookup() patch.speedupFileStorageTxnLookup()
......
...@@ -29,7 +29,7 @@ import struct ...@@ -29,7 +29,7 @@ import struct
import time import time
from . import LOG_QUERIES from . import LOG_QUERIES
from .manager import CreationUndone, DatabaseManager, splitOIDField from .manager import DatabaseManager, splitOIDField
from neo.lib import logging, util from neo.lib import logging, util
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.lib.interfaces import implements from neo.lib.interfaces import implements
......
...@@ -21,9 +21,8 @@ import string ...@@ -21,9 +21,8 @@ import string
import traceback import traceback
from . import LOG_QUERIES from . import LOG_QUERIES
from .manager import CreationUndone, DatabaseManager, splitOIDField from .manager import DatabaseManager, splitOIDField
from neo.lib import logging, util from neo.lib import logging, util
from neo.lib.exception import DatabaseFailure
from neo.lib.interfaces import implements from neo.lib.interfaces import implements
from neo.lib.protocol import CellStates, ZERO_OID, ZERO_TID, ZERO_HASH from neo.lib.protocol import CellStates, ZERO_OID, ZERO_TID, ZERO_HASH
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from neo.lib import logging from neo.lib import logging
from neo.lib.handler import EventHandler from neo.lib.handler import EventHandler
from neo.lib.protocol import uuid_str, NodeTypes, NotReadyError, Packets from neo.lib.protocol import NodeTypes, NotReadyError, Packets
from neo.lib.protocol import ProtocolError, BrokenNodeDisallowedError from neo.lib.protocol import ProtocolError, BrokenNodeDisallowedError
from .storage import StorageOperationHandler from .storage import StorageOperationHandler
from .client import ClientOperationHandler, ClientReadOnlyOperationHandler from .client import ClientOperationHandler, ClientReadOnlyOperationHandler
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
from neo.lib import logging from neo.lib import logging
from neo.lib.util import dump from neo.lib.util import dump
from neo.lib.protocol import Packets, ProtocolError, ZERO_TID from neo.lib.protocol import Packets, ZERO_TID
from . import BaseMasterHandler from . import BaseMasterHandler
......
...@@ -19,7 +19,7 @@ import unittest ...@@ -19,7 +19,7 @@ import unittest
from cPickle import dumps from cPickle import dumps
from mock import Mock, ReturnValues from mock import Mock, ReturnValues
from ZODB.POSException import StorageTransactionError, UndoError, ConflictError from ZODB.POSException import StorageTransactionError, UndoError, ConflictError
from .. import NeoUnitTestBase, buildUrlFromString, ADDRESS_TYPE from .. import NeoUnitTestBase, buildUrlFromString
from neo.client.app import Application from neo.client.app import Application
from neo.client.cache import test as testCache from neo.client.cache import test as testCache
from neo.client.exception import NEOStorageError, NEOStorageNotFoundError from neo.client.exception import NEOStorageError, NEOStorageNotFoundError
......
...@@ -18,9 +18,6 @@ import unittest ...@@ -18,9 +18,6 @@ import unittest
from mock import Mock from mock import Mock
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.pt import PartitionTable
from neo.lib.protocol import NodeTypes
from neo.client.handlers.master import PrimaryBootstrapHandler
from neo.client.handlers.master import PrimaryNotificationsHandler, \ from neo.client.handlers.master import PrimaryNotificationsHandler, \
PrimaryAnswersHandler PrimaryAnswersHandler
from neo.client.exception import NEOStorageError from neo.client.exception import NEOStorageError
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import os, stat, time import os, stat, time
from persistent import Persistent from persistent import Persistent
from persistent.TimeStamp import TimeStamp
from BTrees.OOBTree import OOBTree from BTrees.OOBTree import OOBTree
class Inode(OOBTree): class Inode(OOBTree):
......
...@@ -26,7 +26,6 @@ from ZODB.FileStorage import FileStorage ...@@ -26,7 +26,6 @@ from ZODB.FileStorage import FileStorage
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from ZODB.tests.StorageTestBase import zodb_pickle from ZODB.tests.StorageTestBase import zodb_pickle
from persistent import Persistent from persistent import Persistent
from .. import expectedFailure
from . import NEOCluster, NEOFunctionalTest from . import NEOCluster, NEOFunctionalTest
TREE_SIZE = 6 TREE_SIZE = 6
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
import unittest import unittest
from collections import defaultdict from collections import defaultdict
from mock import Mock
from .. import NeoUnitTestBase from .. import NeoUnitTestBase
from neo.lib.protocol import NodeStates, CellStates from neo.lib.protocol import NodeStates, CellStates
from neo.lib.pt import PartitionTableException from neo.lib.pt import PartitionTableException
......
...@@ -22,7 +22,7 @@ from neo.storage.app import Application ...@@ -22,7 +22,7 @@ from neo.storage.app import Application
from neo.storage.handlers.master import MasterOperationHandler from neo.storage.handlers.master import MasterOperationHandler
from neo.lib.exception import PrimaryFailure from neo.lib.exception import PrimaryFailure
from neo.lib.pt import PartitionTable from neo.lib.pt import PartitionTable
from neo.lib.protocol import CellStates, ProtocolError, Packets from neo.lib.protocol import CellStates, Packets
class StorageMasterHandlerTests(NeoUnitTestBase): class StorageMasterHandlerTests(NeoUnitTestBase):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
import MySQLdb from MySQLdb import OperationalError
from mock import Mock from mock import Mock
from neo.lib.exception import DatabaseFailure from neo.lib.exception import DatabaseFailure
from neo.lib.util import p64 from neo.lib.util import p64
...@@ -59,7 +59,6 @@ class StorageMySQLdbTests(StorageDBTests): ...@@ -59,7 +59,6 @@ class StorageMySQLdbTests(StorageDBTests):
def test_query2(self): def test_query2(self):
# test the OperationalError exception # test the OperationalError exception
# fake object, raise exception during the first call # fake object, raise exception during the first call
from MySQLdb import OperationalError
from MySQLdb.constants.CR import SERVER_GONE_ERROR from MySQLdb.constants.CR import SERVER_GONE_ERROR
class FakeConn(object): class FakeConn(object):
def query(*args): def query(*args):
...@@ -78,7 +77,6 @@ class StorageMySQLdbTests(StorageDBTests): ...@@ -78,7 +77,6 @@ class StorageMySQLdbTests(StorageDBTests):
def test_query3(self): def test_query3(self):
# OperationalError > raise DatabaseFailure exception # OperationalError > raise DatabaseFailure exception
from MySQLdb import OperationalError
class FakeConn(object): class FakeConn(object):
def close(self): def close(self):
pass pass
......
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
import unittest import unittest
from mock import Mock from mock import Mock
from neo.lib import protocol
from neo.lib.protocol import NodeTypes, NodeStates from neo.lib.protocol import NodeTypes, NodeStates
from neo.lib.node import Node, NodeManager, MasterDB from neo.lib.node import Node, MasterDB
from . import NeoUnitTestBase, getTempDirectory from . import NeoUnitTestBase, getTempDirectory
from time import time from time import time
from os import chmod, mkdir, rmdir, unlink from os import chmod, mkdir, rmdir, unlink
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest import unittest
from mock import Mock
from neo.lib.protocol import NodeStates, CellStates from neo.lib.protocol import NodeStates, CellStates
from neo.lib.pt import Cell, PartitionTable, PartitionTableException from neo.lib.pt import Cell, PartitionTable, PartitionTableException
from . import NeoUnitTestBase from . import NeoUnitTestBase
......
...@@ -18,7 +18,7 @@ from collections import deque ...@@ -18,7 +18,7 @@ from collections import deque
from cPickle import Pickler, Unpickler from cPickle import Pickler, Unpickler
from cStringIO import StringIO from cStringIO import StringIO
from itertools import islice, izip_longest from itertools import islice, izip_longest
import os, time, unittest import os, unittest
import neo, transaction, ZODB import neo, transaction, ZODB
from neo.lib import logging from neo.lib import logging
from neo.lib.util import u64 from neo.lib.util import u64
......
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