diff options
Diffstat (limited to 'pyload/remote')
-rw-r--r-- | pyload/remote/SocketBackend.py | 2 | ||||
-rw-r--r-- | pyload/remote/socketbackend/create_ttypes.py | 6 | ||||
-rw-r--r-- | pyload/remote/thriftbackend/Protocol.py | 1 | ||||
-rw-r--r-- | pyload/remote/thriftbackend/ThriftTest.py | 3 |
4 files changed, 9 insertions, 3 deletions
diff --git a/pyload/remote/SocketBackend.py b/pyload/remote/SocketBackend.py index 05b2d8425..8b74d19ff 100644 --- a/pyload/remote/SocketBackend.py +++ b/pyload/remote/SocketBackend.py @@ -6,6 +6,7 @@ from pyload.manager.Remote import BackendBase class RequestHandler(SocketServer.BaseRequestHandler): + def setup(self): pass @@ -15,6 +16,7 @@ class RequestHandler(SocketServer.BaseRequestHandler): class SocketBackend(BackendBase): + def setup(self, host, port): # local only self.server = SocketServer.ThreadingTCPServer(("localhost", port), RequestHandler) diff --git a/pyload/remote/socketbackend/create_ttypes.py b/pyload/remote/socketbackend/create_ttypes.py index 722da8d56..9b001f1bf 100644 --- a/pyload/remote/socketbackend/create_ttypes.py +++ b/pyload/remote/socketbackend/create_ttypes.py @@ -49,7 +49,8 @@ class BaseObject(object): f.write("class %s:\n" % name) for attr in dir(enum): - if attr.startswith("_") or attr in ("read", "write"): continue + if attr.startswith("_") or attr in ("read", "write"): + continue f.write("\t%s = %s\n" % (attr, getattr(enum, attr))) @@ -73,7 +74,8 @@ class BaseObject(object): f.write("class Iface(object):\n") for name in dir(Iface): - if name.startswith("_"): continue + if name.startswith("_"): + continue func = inspect.getargspec(getattr(Iface, name)) diff --git a/pyload/remote/thriftbackend/Protocol.py b/pyload/remote/thriftbackend/Protocol.py index cc5352d40..ecf0680ad 100644 --- a/pyload/remote/thriftbackend/Protocol.py +++ b/pyload/remote/thriftbackend/Protocol.py @@ -27,6 +27,7 @@ class Protocol(TBinaryProtocol.TBinaryProtocol): class ProtocolFactory(TBinaryProtocol.TBinaryProtocolFactory): + def getProtocol(self, trans): prot = Protocol(trans, self.strictRead, self.strictWrite) return prot diff --git a/pyload/remote/thriftbackend/ThriftTest.py b/pyload/remote/thriftbackend/ThriftTest.py index fb8dd03c9..0c5ea4783 100644 --- a/pyload/remote/thriftbackend/ThriftTest.py +++ b/pyload/remote/thriftbackend/ThriftTest.py @@ -22,9 +22,10 @@ from time import time 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 range(0, 100)] e = time() try: print "%s: %f s" % (f._Method__name, e-s) |