partial cleanup of Peer.py

This commit is contained in:
Matthew Bell 2015-06-17 23:03:11 +01:00
parent 3f14d3d200
commit 82b8a9f6c3
1 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@ class Peer(object):
self.connection = None
self.last_found = None # Time of last found in the torrent tracker
self.last_response = None # Time of last successfull response from peer
self.last_response = None # Time of last successful response from peer
self.last_ping = None # Last response time for ping
self.added = time.time()
@ -77,7 +77,7 @@ class Peer(object):
self.last_found = time.time()
# Send a command to peer
def request(self, cmd, params = {}):
def request(self, cmd, params={}):
if not self.connection or self.connection.closed:
self.connect()
if not self.connection:
@ -102,7 +102,7 @@ class Peer(object):
self.last_response = time.time()
return response
except Exception, err:
if type(err).__name__ == "Notify": # Greenlet kill by worker
if type(err).__name__ == "Notify": # Greenlet killed by worker
self.log("Peer worker got killed: %s, aborting cmd: %s" % (err.message, cmd))
break
else: