Commit b1e46c47 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix (some) pyflakes warnings in generic code.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@782 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 0a4a4430
...@@ -17,16 +17,14 @@ ...@@ -17,16 +17,14 @@
import logging import logging
from neo.locking import RLock from neo.locking import RLock
import sys
from neo import protocol from neo import protocol
from neo.protocol import Packet, PacketMalformedError from neo.protocol import PacketMalformedError
from neo.event import IdleEvent from neo.event import IdleEvent
from neo.connector import ConnectorException, ConnectorTryAgainException, \ from neo.connector import ConnectorException, ConnectorTryAgainException, \
ConnectorInProgressException, ConnectorConnectionRefusedException, \ ConnectorInProgressException, ConnectorConnectionRefusedException, \
ConnectorConnectionClosedException ConnectorConnectionClosedException
from neo.util import dump from neo.util import dump
from neo.exception import OperationFailure
def not_closed(func): def not_closed(func):
def decorator(self, *args, **kw): def decorator(self, *args, **kw):
......
...@@ -93,8 +93,8 @@ class SocketConnector: ...@@ -93,8 +93,8 @@ class SocketConnector:
new_s, addr = self.socket.accept() new_s, addr = self.socket.accept()
new_s = SocketConnector(new_s, accepted_from=addr) new_s = SocketConnector(new_s, accepted_from=addr)
return new_s, addr return new_s, addr
except socket.error, m: except socket.error, (err, errmsg):
if m[0] == errno.EAGAIN: if err == errno.EAGAIN:
raise ConnectorTryAgainException raise ConnectorTryAgainException
raise ConnectorException, 'getNewConnection failed: %s:%s' % (err, errmsg) raise ConnectorException, 'getNewConnection failed: %s:%s' % (err, errmsg)
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import logging
from neo import protocol from neo import protocol
# Some decorators useful to avoid duplication of patterns in handlers # Some decorators useful to avoid duplication of patterns in handlers
......
...@@ -20,7 +20,6 @@ from select import select ...@@ -20,7 +20,6 @@ from select import select
from time import time from time import time
from neo import protocol from neo import protocol
from neo.protocol import Packet
from neo.epoll import Epoll from neo.epoll import Epoll
class IdleEvent(object): class IdleEvent(object):
...@@ -117,7 +116,7 @@ class SelectEventManager(object): ...@@ -117,7 +116,7 @@ class SelectEventManager(object):
if to_process.hasPendingMessages(): if to_process.hasPendingMessages():
self._addPendingConnection(to_process) self._addPendingConnection(to_process)
def poll(self, timeout = 1): def _poll(self, timeout = 1):
rlist, wlist, xlist = select(self.reader_set, self.writer_set, self.exc_list, rlist, wlist, xlist = select(self.reader_set, self.writer_set, self.exc_list,
timeout) timeout)
for s in rlist: for s in rlist:
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import logging, traceback import logging
from neo import protocol from neo import protocol
from neo.protocol import Packet, PacketMalformedError, UnexpectedPacketError, \ from neo.protocol import PacketMalformedError, UnexpectedPacketError, \
BrokenNodeDisallowedError, NotReadyError, ProtocolError BrokenNodeDisallowedError, NotReadyError, ProtocolError
from neo.connection import ServerConnection from neo.connection import ServerConnection
......
...@@ -86,7 +86,7 @@ if VERBOSE_LOCKING: ...@@ -86,7 +86,7 @@ if VERBOSE_LOCKING:
return self.lock.release() return self.lock.release()
def _locked(self): def _locked(self):
raise NotImplemetedError raise NotImplementedError
def __repr__(self): def __repr__(self):
return '<%s@%X>' % (self.__class__.__name__, id(self)) return '<%s@%X>' % (self.__class__.__name__, id(self))
......
...@@ -22,7 +22,7 @@ from neo import protocol ...@@ -22,7 +22,7 @@ from neo import protocol
from neo.protocol import RUNNING_STATE, TEMPORARILY_DOWN_STATE, DOWN_STATE, \ from neo.protocol import RUNNING_STATE, TEMPORARILY_DOWN_STATE, DOWN_STATE, \
BROKEN_STATE, PENDING_STATE, HIDDEN_STATE, MASTER_NODE_TYPE, \ BROKEN_STATE, PENDING_STATE, HIDDEN_STATE, MASTER_NODE_TYPE, \
STORAGE_NODE_TYPE, CLIENT_NODE_TYPE, ADMIN_NODE_TYPE, \ STORAGE_NODE_TYPE, CLIENT_NODE_TYPE, ADMIN_NODE_TYPE, \
VALID_NODE_STATE_LIST, ADMIN_NODE_TYPE VALID_NODE_STATE_LIST
from neo.util import dump from neo.util import dump
class Node(object): class Node(object):
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
import struct import struct
from struct import pack, unpack from struct import pack, unpack
from socket import inet_ntoa, inet_aton from socket import inet_ntoa, inet_aton
import logging #import logging
from neo.util import dump #from neo.util import dump
class EnumItem(int): class EnumItem(int):
""" """
......
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