Commit a20c1279 authored by Vincent Pelletier's avatar Vincent Pelletier

Reindent to 4 spaces.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@894 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4fcd66f7
......@@ -31,8 +31,8 @@ def getConnectorHandler(connector):
if isinstance(connector, basestring):
connector_handler = connector_registry.get(connector)
else:
# Allow to directly provide a handler class without requiring to register
# it first.
# Allow to directly provide a handler class without requiring to
# register it first.
connector_handler = connector
return connector_handler
......@@ -66,9 +66,11 @@ class SocketConnector:
raise ConnectorInProgressException
if err == errno.ECONNREFUSED:
raise ConnectorConnectionRefusedException
raise ConnectorException, 'makeClientConnection failed: %s:%s' % (err, errmsg)
raise ConnectorException, 'makeClientConnection failed: ' \
'%s:%s' % (err, errmsg)
finally:
logging.debug('%r connecting to %r', self.socket.getsockname(), addr)
logging.debug('%r connecting to %r', self.socket.getsockname(),
addr)
def makeListeningConnection(self, addr):
self.is_closed = False
......@@ -80,7 +82,8 @@ class SocketConnector:
self.socket.listen(5)
except socket.error, (err, errmsg):
self.socket.close()
raise ConnectorException, 'makeListeningConnection failed: %s:%s' % (err, errmsg)
raise ConnectorException, 'makeListeningConnection failed: %s:%s' % \
(err, errmsg)
def getError(self):
return self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
......@@ -98,7 +101,8 @@ class SocketConnector:
except socket.error, (err, errmsg):
if err == errno.EAGAIN:
raise ConnectorTryAgainException
raise ConnectorException, 'getNewConnection failed: %s:%s' % (err, errmsg)
raise ConnectorException, 'getNewConnection failed: %s:%s' % \
(err, errmsg)
def shutdown(self):
# This may fail if the socket is not connected.
......@@ -138,8 +142,8 @@ class SocketConnector:
fileno = str(self.socket.fileno())
except socket.error, (err, errmsg):
fileno = '?'
result = '<%s at 0x%x fileno %s %s>' % (self.__class__.__name__, id(self),
fileno, self.socket.getsockname())
result = '<%s at 0x%x fileno %s %s>' % (self.__class__.__name__,
id(self), fileno, self.socket.getsockname())
if self.is_closed is None:
result += 'never opened'
else:
......
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