summaryrefslogtreecommitdiffstats
path: root/pyload/remote/thriftbackend
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/remote/thriftbackend')
-rw-r--r--pyload/remote/thriftbackend/Processor.py2
-rw-r--r--pyload/remote/thriftbackend/Socket.py4
-rw-r--r--pyload/remote/thriftbackend/ThriftClient.py4
-rw-r--r--pyload/remote/thriftbackend/ThriftTest.py6
4 files changed, 8 insertions, 8 deletions
diff --git a/pyload/remote/thriftbackend/Processor.py b/pyload/remote/thriftbackend/Processor.py
index 7ccc2bee2..204047e2f 100644
--- a/pyload/remote/thriftbackend/Processor.py
+++ b/pyload/remote/thriftbackend/Processor.py
@@ -57,7 +57,7 @@ class Processor(Pyload.Processor):
# api login
self.authenticated[trans] = self._handler.checkAuth(args.username, args.password, trans.remoteaddr[0])
- result.success = True if self.authenticated[trans] else False
+ result.success = bool(self.authenticated[trans])
oprot.writeMessageBegin("login", Pyload.TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
diff --git a/pyload/remote/thriftbackend/Socket.py b/pyload/remote/thriftbackend/Socket.py
index 3d2435a92..0ca9ed178 100644
--- a/pyload/remote/thriftbackend/Socket.py
+++ b/pyload/remote/thriftbackend/Socket.py
@@ -68,7 +68,7 @@ class Socket(TSocket):
else:
self.handle = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- #errno 104 connection reset
+ # errno 104 connection reset
self.handle.settimeout(self._timeout)
self.handle.connect((self.host, self.port))
@@ -94,7 +94,7 @@ class Socket(TSocket):
if e.args == (-1, 'Unexpected EOF'):
buff = ''
elif e.args == ([('SSL routines', 'SSL23_GET_CLIENT_HELLO', 'unknown protocol')],):
- #a socket not using ssl tried to connect
+ # a socket not using ssl tried to connect
buff = ''
else:
raise
diff --git a/pyload/remote/thriftbackend/ThriftClient.py b/pyload/remote/thriftbackend/ThriftClient.py
index 4f1c8dcc2..b018fbcc4 100644
--- a/pyload/remote/thriftbackend/ThriftClient.py
+++ b/pyload/remote/thriftbackend/ThriftClient.py
@@ -49,10 +49,10 @@ class ThriftClient(object):
correct = self.client.login(user, password)
except error, e:
if e.args and e.args[0] == 104:
- #connection reset by peer, probably wants ssl
+ # connection reset by peer, probably wants ssl
try:
self.createConnection(host, port, True)
- #set timeout or a ssl socket will block when querying none ssl server
+ # set timeout or a ssl socket will block when querying none ssl server
self.socket.setTimeout(10)
except ImportError:
diff --git a/pyload/remote/thriftbackend/ThriftTest.py b/pyload/remote/thriftbackend/ThriftTest.py
index 0c5ea4783..c95e060b8 100644
--- a/pyload/remote/thriftbackend/ThriftTest.py
+++ b/pyload/remote/thriftbackend/ThriftTest.py
@@ -25,7 +25,7 @@ import xmlrpclib
def bench(f, *args, **kwargs):
s = time()
- ret = [f(*args, **kwargs) for _i in range(0, 100)]
+ ret = [f(*args, **kwargs) for _i in xrange(0, 100)]
e = time()
try:
print "%s: %f s" % (f._Method__name, e-s)
@@ -74,8 +74,8 @@ try:
bench(client.getServerVersion)
bench(client.statusServer)
bench(client.statusDownloads)
- #bench(client.getQueue)
- #bench(client.getCollector)
+ # bench(client.getQueue)
+ # bench(client.getCollector)
print
print client.getServerVersion()