From e00ef98491f79ae8aa972ae1473dae4a7b78c07e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 13 Apr 2015 17:20:59 +0200 Subject: Cleanup --- pyload/remote/thriftbackend/ThriftClient.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pyload/remote/thriftbackend/ThriftClient.py') diff --git a/pyload/remote/thriftbackend/ThriftClient.py b/pyload/remote/thriftbackend/ThriftClient.py index 26658e341..c779c9b9c 100644 --- a/pyload/remote/thriftbackend/ThriftClient.py +++ b/pyload/remote/thriftbackend/ThriftClient.py @@ -36,6 +36,7 @@ class NoSSL(Exception): pass class ThriftClient(object): + def __init__(self, host="localhost", port=7227, user="", password=""): self.createConnection(host, port) @@ -76,6 +77,7 @@ class ThriftClient(object): self.transport.close() raise WrongLogin + def createConnection(self, host, port, ssl=False): self.socket = Socket(host, port, ssl) self.transport = TTransport.TBufferedTransport(self.socket) @@ -84,8 +86,10 @@ class ThriftClient(object): protocol = Protocol(self.transport) self.client = Pyload.Client(protocol) + def close(self): self.transport.close() + def __getattr__(self, item): return getattr(self.client, item) -- cgit v1.2.3