mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
Flake8 core files
This commit is contained in:
parent
a2c3fb3d5e
commit
32330f99fc
@ -375,7 +375,7 @@ class PreferencesManager(component.Component):
|
||||
def _on_set_send_info(self, key, value):
|
||||
log.debug("Sending anonymous stats..")
|
||||
"""sends anonymous stats home"""
|
||||
class Send_Info_Thread(threading.Thread):
|
||||
class SendInfoThread(threading.Thread):
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
threading.Thread.__init__(self)
|
||||
@ -401,7 +401,7 @@ class PreferencesManager(component.Component):
|
||||
else:
|
||||
self.config["info_sent"] = now
|
||||
if value:
|
||||
Send_Info_Thread(self.config).start()
|
||||
SendInfoThread(self.config).start()
|
||||
|
||||
def _on_set_new_release_check(self, key, value):
|
||||
if value:
|
||||
|
@ -220,7 +220,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||
:type kwargs: dict
|
||||
|
||||
"""
|
||||
def sendError():
|
||||
def send_error():
|
||||
"""
|
||||
Sends an error response with the contents of the exception that was raised.
|
||||
"""
|
||||
@ -243,7 +243,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||
try:
|
||||
raise WrappedException(str(exceptionValue), exceptionType.__name__, formated_tb)
|
||||
except:
|
||||
sendError()
|
||||
send_error()
|
||||
except Exception, err:
|
||||
log.error("An exception occurred while sending RPC_ERROR to client: %s", err)
|
||||
|
||||
@ -264,7 +264,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||
self.factory.authorized_sessions[self.transport.sessionno] = (ret, args[0])
|
||||
self.factory.session_protocols[self.transport.sessionno] = self
|
||||
except Exception, e:
|
||||
sendError()
|
||||
send_error()
|
||||
if not isinstance(e, _ClientSideRecreateError):
|
||||
log.exception(e)
|
||||
else:
|
||||
@ -283,7 +283,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||
self.factory.interested_events[self.transport.sessionno] = []
|
||||
self.factory.interested_events[self.transport.sessionno].extend(args[0])
|
||||
except Exception, e:
|
||||
sendError()
|
||||
send_error()
|
||||
else:
|
||||
self.sendData((RPC_RESPONSE, request_id, (True)))
|
||||
finally:
|
||||
@ -304,7 +304,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||
self.factory.session_id = self.transport.sessionno
|
||||
ret = self.factory.methods[method](*args, **kwargs)
|
||||
except Exception, e:
|
||||
sendError()
|
||||
send_error()
|
||||
# Don't bother printing out DelugeErrors, because they are just
|
||||
# for the client
|
||||
if not isinstance(e, DelugeError):
|
||||
@ -321,7 +321,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
|
||||
try:
|
||||
failure.raiseException()
|
||||
except Exception:
|
||||
sendError()
|
||||
send_error()
|
||||
return failure
|
||||
|
||||
ret.addCallbacks(on_success, on_fail)
|
||||
|
Loading…
x
Reference in New Issue
Block a user