diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-14 19:14:10 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-14 19:14:10 +0100 |
commit | 4aaa1dd526013e01775b1b07e757a33b328659a6 (patch) | |
tree | 00a81f3be666021fa435bd24fb896cb65fa77899 /module | |
parent | closes #232 (diff) | |
download | pyload-4aaa1dd526013e01775b1b07e757a33b328659a6.tar.xz |
finished cli
Diffstat (limited to 'module')
-rw-r--r-- | module/remote/thriftbackend/Handler.py | 44 | ||||
-rw-r--r-- | module/remote/thriftbackend/ThriftClient.py | 6 | ||||
-rw-r--r-- | module/remote/thriftbackend/pyload.thrift | 4 | ||||
-rwxr-xr-x | module/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 14 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/Pyload.py | 408 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/ttypes.py | 16 |
6 files changed, 420 insertions, 72 deletions
diff --git a/module/remote/thriftbackend/Handler.py b/module/remote/thriftbackend/Handler.py index 51764a0f5..1a9625394 100644 --- a/module/remote/thriftbackend/Handler.py +++ b/module/remote/thriftbackend/Handler.py @@ -137,7 +137,7 @@ class Handler(Iface): if not isinstance(pyfile, PyFile): continue status = DownloadInfo() - status.id = pyfile.id + status.fid = pyfile.id status.name = pyfile.name status.speed = pyfile.getSpeed() #bytes status.eta = pyfile.getETA() @@ -220,8 +220,7 @@ class Handler(Iface): def getQueue(self): packs = self.serverMethods.get_queue() ret = [] - for pid in packs: - pack = self.serverMethods.get_package_data(pid) + for pid, pack in packs.iteritems(): pdata = PackageInfo() pdata.pid = pack["id"] pdata.name = pack["name"] @@ -235,11 +234,27 @@ class Handler(Iface): ret.append(pdata) return ret - def getCollector(self): + def getQueueData(self): packs = self.serverMethods.get_queue() ret = [] - for pid in packs: - pack = self.serverMethods.get_package_data(pid) + for pid, pack in packs.iteritems(): + pdata = PackageData() + pdata.pid = pack["id"] + pdata.name = pack["name"] + pdata.folder = pack["folder"] + pdata.site = pack["site"] + pdata.password = pack["password"] + pdata.dest = pack["queue"] + pdata.order = pack["order"] + pdata.priority = pack["priority"] + pdata.links = [self._convertPyFile(x) for x in pack["links"].values()] + ret.append(pdata) + return ret + + def getCollector(self): + packs = self.serverMethods.get_collector() + ret = [] + for pid, pack in packs.iteritems(): pdata = PackageInfo() pdata.pid = pack["id"] pdata.name = pack["name"] @@ -249,6 +264,23 @@ class Handler(Iface): pdata.dest = pack["queue"] pdata.order = pack["order"] pdata.priority = pack["priority"] + pdata.links = [self._convertPyFile(x) for x in pack["links"].values()] + ret.append(pdata) + return ret + + def getCollectorData(self): + packs = self.serverMethods.get_collector() + ret = [] + for pid, pack in packs.iteritems(): + pdata = PackageData() + pdata.pid = pack["id"] + pdata.name = pack["name"] + pdata.folder = pack["folder"] + pdata.site = pack["site"] + pdata.password = pack["password"] + pdata.dest = pack["queue"] + pdata.order = pack["order"] + pdata.priority = pack["priority"] pdata.links = [int(x) for x in pack["links"].keys()] ret.append(pdata) return ret diff --git a/module/remote/thriftbackend/ThriftClient.py b/module/remote/thriftbackend/ThriftClient.py index c5beec96e..d5c203cf0 100644 --- a/module/remote/thriftbackend/ThriftClient.py +++ b/module/remote/thriftbackend/ThriftClient.py @@ -57,6 +57,10 @@ class ThriftClient: correct = self.client.login(user, password) finally: self.socket.setTimeout(None) + elif e.args and e.args[0] == 32: + raise NoConnection + else: + raise if not correct: self.transport.close() @@ -77,7 +81,7 @@ class ThriftClient: if __name__ == "__main__": - client = ThriftClient(user="User", password="pyloadweb") + client = ThriftClient(user="User", password="") print client.getServerVersion() print client.statusServer() diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index a8c295339..7ea1d5f94 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -34,7 +34,7 @@ enum ElementType { } struct DownloadInfo { - 1: FileID id, + 1: FileID fid, 2: string name, 3: i64 speed, 4: i32 eta, @@ -188,6 +188,8 @@ service Pyload { void deletePackages(1: list<PackageID> pids), list<PackageInfo> getQueue(), list<PackageInfo> getCollector(), + list<PackageData> getQueueData(), + list<PackageData> getCollectorData(), void addFiles(1: PackageID pid, 2: LinkList links), void pushToQueue(1: PackageID pid), void pullFromQueue(1: PackageID pid), diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index f8e047e49..92edffa14 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -45,6 +45,8 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void deletePackages( pids)' print ' getQueue()' print ' getCollector()' + print ' getQueueData()' + print ' getCollectorData()' print ' void addFiles(PackageID pid, LinkList links)' print ' void pushToQueue(PackageID pid)' print ' void pullFromQueue(PackageID pid)' @@ -269,6 +271,18 @@ elif cmd == 'getCollector': sys.exit(1) pp.pprint(client.getCollector()) +elif cmd == 'getQueueData': + if len(args) != 0: + print 'getQueueData requires 0 args' + sys.exit(1) + pp.pprint(client.getQueueData()) + +elif cmd == 'getCollectorData': + if len(args) != 0: + print 'getCollectorData requires 0 args' + sys.exit(1) + pp.pprint(client.getCollectorData()) + elif cmd == 'addFiles': if len(args) != 2: print 'addFiles requires 2 args' diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index 7c2372745..92220471b 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -131,6 +131,12 @@ class Iface: def getCollector(self, ): pass + def getQueueData(self, ): + pass + + def getCollectorData(self, ): + pass + def addFiles(self, pid, links): """ Parameters: @@ -985,6 +991,56 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getCollector failed: unknown result"); + def getQueueData(self, ): + self.send_getQueueData() + return self.recv_getQueueData() + + def send_getQueueData(self, ): + self._oprot.writeMessageBegin('getQueueData', TMessageType.CALL, self._seqid) + args = getQueueData_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getQueueData(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getQueueData_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueueData failed: unknown result"); + + def getCollectorData(self, ): + self.send_getCollectorData() + return self.recv_getCollectorData() + + def send_getCollectorData(self, ): + self._oprot.writeMessageBegin('getCollectorData', TMessageType.CALL, self._seqid) + args = getCollectorData_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getCollectorData(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getCollectorData_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getCollectorData failed: unknown result"); + def addFiles(self, pid, links): """ Parameters: @@ -1866,6 +1922,8 @@ class Processor(Iface, TProcessor): self._processMap["deletePackages"] = Processor.process_deletePackages self._processMap["getQueue"] = Processor.process_getQueue self._processMap["getCollector"] = Processor.process_getCollector + self._processMap["getQueueData"] = Processor.process_getQueueData + self._processMap["getCollectorData"] = Processor.process_getCollectorData self._processMap["addFiles"] = Processor.process_addFiles self._processMap["pushToQueue"] = Processor.process_pushToQueue self._processMap["pullFromQueue"] = Processor.process_pullFromQueue @@ -2182,6 +2240,28 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_getQueueData(self, seqid, iprot, oprot): + args = getQueueData_args() + args.read(iprot) + iprot.readMessageEnd() + result = getQueueData_result() + result.success = self._handler.getQueueData() + oprot.writeMessageBegin("getQueueData", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getCollectorData(self, seqid, iprot, oprot): + args = getCollectorData_args() + args.read(iprot) + iprot.readMessageEnd() + result = getCollectorData_result() + result.success = self._handler.getCollectorData() + oprot.writeMessageBegin("getCollectorData", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_addFiles(self, seqid, iprot, oprot): args = addFiles_args() args.read(iprot) @@ -5142,6 +5222,222 @@ class getCollector_result: def __ne__(self, other): return not (self == other) +class getQueueData_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getQueueData_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getQueueData_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype121, _size118) = iprot.readListBegin() + for _i122 in xrange(_size118): + _elem123 = PackageData() + _elem123.read(iprot) + self.success.append(_elem123) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getQueueData_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter124 in self.success: + iter124.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getCollectorData_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getCollectorData_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getCollectorData_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype128, _size125) = iprot.readListBegin() + for _i129 in xrange(_size125): + _elem130 = PackageData() + _elem130.read(iprot) + self.success.append(_elem130) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getCollectorData_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter131 in self.success: + iter131.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class addFiles_args: """ Attributes: @@ -5176,10 +5472,10 @@ class addFiles_args: elif fid == 2: if ftype == TType.LIST: self.links = [] - (_etype121, _size118) = iprot.readListBegin() - for _i122 in xrange(_size118): - _elem123 = iprot.readString(); - self.links.append(_elem123) + (_etype135, _size132) = iprot.readListBegin() + for _i136 in xrange(_size132): + _elem137 = iprot.readString(); + self.links.append(_elem137) iprot.readListEnd() else: iprot.skip(ftype) @@ -5200,8 +5496,8 @@ class addFiles_args: if self.links != None: oprot.writeFieldBegin('links', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.links)) - for iter124 in self.links: - oprot.writeString(iter124) + for iter138 in self.links: + oprot.writeString(iter138) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5870,10 +6166,10 @@ class stopDownloads_args: if fid == 1: if ftype == TType.LIST: self.fids = [] - (_etype128, _size125) = iprot.readListBegin() - for _i129 in xrange(_size125): - _elem130 = iprot.readI32(); - self.fids.append(_elem130) + (_etype142, _size139) = iprot.readListBegin() + for _i143 in xrange(_size139): + _elem144 = iprot.readI32(); + self.fids.append(_elem144) iprot.readListEnd() else: iprot.skip(ftype) @@ -5890,8 +6186,8 @@ class stopDownloads_args: if self.fids != None: oprot.writeFieldBegin('fids', TType.LIST, 1) oprot.writeListBegin(TType.I32, len(self.fids)) - for iter131 in self.fids: - oprot.writeI32(iter131) + for iter145 in self.fids: + oprot.writeI32(iter145) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6658,11 +6954,11 @@ class setPackageData_args: elif fid == 2: if ftype == TType.MAP: self.data = {} - (_ktype133, _vtype134, _size132 ) = iprot.readMapBegin() - for _i136 in xrange(_size132): - _key137 = iprot.readString(); - _val138 = iprot.readString(); - self.data[_key137] = _val138 + (_ktype147, _vtype148, _size146 ) = iprot.readMapBegin() + for _i150 in xrange(_size146): + _key151 = iprot.readString(); + _val152 = iprot.readString(); + self.data[_key151] = _val152 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6683,9 +6979,9 @@ class setPackageData_args: if self.data != None: oprot.writeFieldBegin('data', TType.MAP, 2) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.data)) - for kiter139,viter140 in self.data.items(): - oprot.writeString(kiter139) - oprot.writeString(viter140) + for kiter153,viter154 in self.data.items(): + oprot.writeString(kiter153) + oprot.writeString(viter154) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6994,11 +7290,11 @@ class getPackageOrder_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype142, _vtype143, _size141 ) = iprot.readMapBegin() - for _i145 in xrange(_size141): - _key146 = iprot.readI16(); - _val147 = iprot.readI32(); - self.success[_key146] = _val147 + (_ktype156, _vtype157, _size155 ) = iprot.readMapBegin() + for _i159 in xrange(_size155): + _key160 = iprot.readI16(); + _val161 = iprot.readI32(); + self.success[_key160] = _val161 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7015,9 +7311,9 @@ class getPackageOrder_result: if self.success != None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.I16, TType.I32, len(self.success)) - for kiter148,viter149 in self.success.items(): - oprot.writeI16(kiter148) - oprot.writeI32(viter149) + for kiter162,viter163 in self.success.items(): + oprot.writeI16(kiter162) + oprot.writeI32(viter163) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7121,11 +7417,11 @@ class getFileOrder_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype151, _vtype152, _size150 ) = iprot.readMapBegin() - for _i154 in xrange(_size150): - _key155 = iprot.readI16(); - _val156 = iprot.readI32(); - self.success[_key155] = _val156 + (_ktype165, _vtype166, _size164 ) = iprot.readMapBegin() + for _i168 in xrange(_size164): + _key169 = iprot.readI16(); + _val170 = iprot.readI32(); + self.success[_key169] = _val170 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7142,9 +7438,9 @@ class getFileOrder_result: if self.success != None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.I16, TType.I32, len(self.success)) - for kiter157,viter158 in self.success.items(): - oprot.writeI16(kiter157) - oprot.writeI32(viter158) + for kiter171,viter172 in self.success.items(): + oprot.writeI16(kiter171) + oprot.writeI32(viter172) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7694,11 +7990,11 @@ class getEvents_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype162, _size159) = iprot.readListBegin() - for _i163 in xrange(_size159): - _elem164 = Event() - _elem164.read(iprot) - self.success.append(_elem164) + (_etype176, _size173) = iprot.readListBegin() + for _i177 in xrange(_size173): + _elem178 = Event() + _elem178.read(iprot) + self.success.append(_elem178) iprot.readListEnd() else: iprot.skip(ftype) @@ -7715,8 +8011,8 @@ class getEvents_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter165 in self.success: - iter165.write(oprot) + for iter179 in self.success: + iter179.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7820,11 +8116,11 @@ class getAccounts_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype169, _size166) = iprot.readListBegin() - for _i170 in xrange(_size166): - _elem171 = AccountInfo() - _elem171.read(iprot) - self.success.append(_elem171) + (_etype183, _size180) = iprot.readListBegin() + for _i184 in xrange(_size180): + _elem185 = AccountInfo() + _elem185.read(iprot) + self.success.append(_elem185) iprot.readListEnd() else: iprot.skip(ftype) @@ -7841,8 +8137,8 @@ class getAccounts_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter172 in self.success: - iter172.write(oprot) + for iter186 in self.success: + iter186.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7928,10 +8224,10 @@ class getAccountTypes_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype176, _size173) = iprot.readListBegin() - for _i177 in xrange(_size173): - _elem178 = iprot.readString(); - self.success.append(_elem178) + (_etype190, _size187) = iprot.readListBegin() + for _i191 in xrange(_size187): + _elem192 = iprot.readString(); + self.success.append(_elem192) iprot.readListEnd() else: iprot.skip(ftype) @@ -7948,8 +8244,8 @@ class getAccountTypes_result: if self.success != None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter179 in self.success: - oprot.writeString(iter179) + for iter193 in self.success: + oprot.writeString(iter193) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index 370858d4e..8af392d0a 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -99,7 +99,7 @@ class ElementType: class DownloadInfo: """ Attributes: - - id + - fid - name - speed - eta @@ -117,7 +117,7 @@ class DownloadInfo: thrift_spec = ( None, # 0 - (1, TType.I32, 'id', None, None, ), # 1 + (1, TType.I32, 'fid', None, None, ), # 1 (2, TType.STRING, 'name', None, None, ), # 2 (3, TType.I64, 'speed', None, None, ), # 3 (4, TType.I32, 'eta', None, None, ), # 4 @@ -133,8 +133,8 @@ class DownloadInfo: (14, TType.I32, 'packageID', None, None, ), # 14 ) - def __init__(self, id=None, name=None, speed=None, eta=None, format_eta=None, bleft=None, size=None, format_size=None, percent=None, status=None, statusmsg=None, format_wait=None, wait_until=None, packageID=None,): - self.id = id + def __init__(self, fid=None, name=None, speed=None, eta=None, format_eta=None, bleft=None, size=None, format_size=None, percent=None, status=None, statusmsg=None, format_wait=None, wait_until=None, packageID=None,): + self.fid = fid self.name = name self.speed = speed self.eta = eta @@ -160,7 +160,7 @@ class DownloadInfo: break if fid == 1: if ftype == TType.I32: - self.id = iprot.readI32(); + self.fid = iprot.readI32(); else: iprot.skip(ftype) elif fid == 2: @@ -238,9 +238,9 @@ class DownloadInfo: oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('DownloadInfo') - if self.id != None: - oprot.writeFieldBegin('id', TType.I32, 1) - oprot.writeI32(self.id) + if self.fid != None: + oprot.writeFieldBegin('fid', TType.I32, 1) + oprot.writeI32(self.fid) oprot.writeFieldEnd() if self.name != None: oprot.writeFieldBegin('name', TType.STRING, 2) |