summaryrefslogtreecommitdiffstats
path: root/deluge/ui/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/ui/client.py')
-rw-r--r--deluge/ui/client.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/deluge/ui/client.py b/deluge/ui/client.py
index 686f962b3..6b657d5ca 100644
--- a/deluge/ui/client.py
+++ b/deluge/ui/client.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
@@ -8,8 +7,6 @@
# See LICENSE for more details.
#
-from __future__ import unicode_literals
-
import logging
import subprocess
import sys
@@ -33,7 +30,7 @@ def format_kwargs(kwargs):
return ', '.join([key + '=' + str(value) for key, value in kwargs.items()])
-class DelugeRPCRequest(object):
+class DelugeRPCRequest:
"""
This object is created whenever there is a RPCRequest to be sent to the
daemon. It is generally only used by the DaemonProxy's call method.
@@ -65,7 +62,7 @@ class DelugeRPCRequest(object):
Returns a properly formatted RPCRequest based on the properties. Will
raise a TypeError if the properties haven't been set yet.
- :returns: a properly formated RPCRequest
+ :returns: a properly formatted RPCRequest
"""
if (
self.request_id is None
@@ -150,7 +147,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
# so it could pass back to the 2nd deferred on the chain. But,
# that does not always happen.
# So, just do some instance checking and just log rpc error at
- # diferent levels.
+ # different levels.
r = self.__rpc_requests[request_id]
msg = 'RPCError Message Received!'
msg += '\n' + '-' * 80
@@ -168,7 +165,7 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
# Let's log these as errors
log.error(msg)
else:
- # The rest just get's logged in debug level, just to log
+ # The rest just gets logged in debug level, just to log
# what's happening
log.debug(msg)
except Exception:
@@ -243,7 +240,7 @@ class DelugeRPCClientFactory(ClientFactory):
self.daemon.disconnect_callback()
-class DaemonProxy(object):
+class DaemonProxy:
pass
@@ -526,7 +523,7 @@ class DaemonStandaloneProxy(DaemonProxy):
self.__daemon.core.eventmanager.deregister_event_handler(event, handler)
-class DottedObject(object):
+class DottedObject:
"""
This is used for dotted name calls to client
"""
@@ -551,7 +548,7 @@ class RemoteMethod(DottedObject):
return self.daemon.call(self.base, *args, **kwargs)
-class Client(object):
+class Client:
"""
This class is used to connect to a daemon process and issue RPC requests.
"""
@@ -615,7 +612,7 @@ class Client(object):
d.addErrback(on_authenticate_fail)
return d
- d.addCallback(on_connected)
+ d.addCallbacks(on_connected)
d.addErrback(on_connect_fail)
if not skip_authentication:
d.addCallback(authenticate, username, password)