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