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