diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-01 13:51:34 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-01 13:51:34 +0200 |
commit | 670fb45a46d8723b2c7bf3d667911c567c433283 (patch) | |
tree | fb8de33ae76f8e146ad88b6c0e485fbfec0ead27 /module/remote | |
parent | cleanup (diff) | |
download | pyload-670fb45a46d8723b2c7bf3d667911c567c433283.tar.xz |
new api class + documentation
Diffstat (limited to 'module/remote')
-rw-r--r-- | module/remote/ThriftBackend.py | 4 | ||||
-rw-r--r-- | module/remote/thriftbackend/Handler.py | 4 | ||||
-rw-r--r-- | module/remote/thriftbackend/pyload.thrift | 47 | ||||
-rwxr-xr-x | module/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 91 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/Pyload.py | 976 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/ttypes.py | 73 |
6 files changed, 629 insertions, 566 deletions
diff --git a/module/remote/ThriftBackend.py b/module/remote/ThriftBackend.py index 1a56b0435..b4a2bb25e 100644 --- a/module/remote/ThriftBackend.py +++ b/module/remote/ThriftBackend.py @@ -19,7 +19,6 @@ from os.path import exists from module.remote.RemoteManager import BackendBase -from thriftbackend.Handler import Handler from thriftbackend.Processor import Processor from thriftbackend.Protocol import ProtocolFactory from thriftbackend.Socket import ServerSocket @@ -30,8 +29,7 @@ from thrift.server import TServer class ThriftBackend(BackendBase): def setup(self, host, port): - handler = Handler(self) - processor = Processor(handler) + processor = Processor(self.core.api) key = None cert = None diff --git a/module/remote/thriftbackend/Handler.py b/module/remote/thriftbackend/Handler.py index d518c6e88..998ace06b 100644 --- a/module/remote/thriftbackend/Handler.py +++ b/module/remote/thriftbackend/Handler.py @@ -34,7 +34,7 @@ class Handler(Iface): item = ConfigItem() item.name = key item.description = data["desc"] - item.value = str(data["value"]) if type(data["value"]) not in (str, unicode) else data["value"] + item.value = str(data["value"]) if type(data["value"]) != basestring else data["value"] item.type = data["type"] items.append(item) section.items = items @@ -59,7 +59,7 @@ class Handler(Iface): - value - section """ - self.serverMethods.set_conf_val(category, option, value, section) + pass def getConfig(self): c = self.serverMethods.get_config() diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index 1a3c2d4e5..07f36aec9 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -29,8 +29,8 @@ enum DownloadStatus { } enum Destination { - Queue, - Collector + Collector, + Queue } enum ElementType { @@ -62,7 +62,7 @@ struct ServerStatus { 2: i16 active, 3: i16 queue, 4: i16 total, - 5: i32 speed, + 5: i64 speed, 6: bool download, 7: bool reconnect } @@ -104,19 +104,8 @@ struct PackageData { 6: Destination dest, 7: i16 order, 8: Priority priority, - 9: list<FileData> links -} - -struct PackageInfo { - 1: PackageID pid, - 2: string name, - 3: string folder, - 4: string site, - 5: string password, - 6: Destination dest, - 7: i16 order, - 8: Priority priority, - 9: list<FileID> links + 9: optional list<FileID> fids, + 10: optional list<FileData> links } struct CaptchaTask { @@ -221,18 +210,26 @@ service Pyload { ResultID checkOnlineStatus(1: LinkList urls), map<PluginName, list<OnlineStatus>> pollResults(1: ResultID rid), - //downloads + // downloads - information list<DownloadInfo> statusDownloads(), - PackageID addPackage(1: string name, 2: LinkList links, 3: Destination dest), PackageData getPackageData(1: PackageID pid) throws (1: PackageDoesNotExists e), + PackageData getPackageInfo(1: PackageID pid) throws (1: PackageDoesNotExists e), FileData getFileData(1: FileID fid) throws (1: FileDoesNotExists e), - void deleteFiles(1: list<FileID> fids), - void deletePackages(1: list<PackageID> pids), - list<PackageInfo> getQueue(), - list<PackageInfo> getCollector(), + list<PackageData> getQueue(), + list<PackageData> getCollector(), list<PackageData> getQueueData(), list<PackageData> getCollectorData(), + map<i16, PackageID> getPackageOrder(1: Destination destination), + map<i16, FileID> getFileOrder(1: PackageID pid) + + // downloads - adding/deleting + PackageID addPackage(1: string name, 2: LinkList links, 3: Destination dest), void addFiles(1: PackageID pid, 2: LinkList links), + void uploadContainer(1: string filename, 2: binary data), + void deleteFiles(1: list<FileID> fids), + void deletePackages(1: list<PackageID> pids), + + // downloads - modifying void pushToQueue(1: PackageID pid), void pullFromQueue(1: PackageID pid), void restartPackage(1: PackageID pid), @@ -242,15 +239,13 @@ service Pyload { void stopDownloads(1: list<FileID> fids), void setPackageName(1: PackageID pid, 2: string name), void movePackage(1: Destination destination, 2: PackageID pid), - void uploadContainer(1: string filename, 2: binary data), void setPriority(1: PackageID pid, 2: Priority priority) void orderPackage(1: PackageID pid, 2: i16 position), void orderFile(1: FileID fid, 2: i16 position), - void setPackageData(1: PackageID pid, 2: map<string, string> data), + void setPackageData(1: PackageID pid, 2: map<string, string> data) throws (1: PackageDoesNotExists e), void deleteFinished(), void restartFailed(), - map<i16, PackageID> getPackageOrder(1: Destination destination), - map<i16, FileID> getFileOrder(1: PackageID pid) + //captcha bool isCaptchaWaiting(), diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index 5feb243ef..0e454c816 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -44,16 +44,20 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' ResultID checkOnlineStatus(LinkList urls)' print ' pollResults(ResultID rid)' print ' statusDownloads()' - print ' PackageID addPackage(string name, LinkList links, Destination dest)' print ' PackageData getPackageData(PackageID pid)' + print ' PackageData getPackageInfo(PackageID pid)' print ' FileData getFileData(FileID fid)' - print ' void deleteFiles( fids)' - print ' void deletePackages( pids)' print ' getQueue()' print ' getCollector()' print ' getQueueData()' print ' getCollectorData()' + print ' getPackageOrder(Destination destination)' + print ' getFileOrder(PackageID pid)' + print ' PackageID addPackage(string name, LinkList links, Destination dest)' print ' void addFiles(PackageID pid, LinkList links)' + print ' void uploadContainer(string filename, string data)' + print ' void deleteFiles( fids)' + print ' void deletePackages( pids)' print ' void pushToQueue(PackageID pid)' print ' void pullFromQueue(PackageID pid)' print ' void restartPackage(PackageID pid)' @@ -63,15 +67,12 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void stopDownloads( fids)' print ' void setPackageName(PackageID pid, string name)' print ' void movePackage(Destination destination, PackageID pid)' - print ' void uploadContainer(string filename, string data)' print ' void setPriority(PackageID pid, Priority priority)' print ' void orderPackage(PackageID pid, i16 position)' print ' void orderFile(FileID fid, i16 position)' print ' void setPackageData(PackageID pid, data)' print ' void deleteFinished()' print ' void restartFailed()' - print ' getPackageOrder(Destination destination)' - print ' getFileOrder(PackageID pid)' print ' bool isCaptchaWaiting()' print ' CaptchaTask getCaptchaTask(bool exclusive)' print ' string getCaptchaTaskStatus(TaskID tid)' @@ -264,35 +265,23 @@ elif cmd == 'statusDownloads': sys.exit(1) pp.pprint(client.statusDownloads()) -elif cmd == 'addPackage': - if len(args) != 3: - print 'addPackage requires 3 args' - sys.exit(1) - pp.pprint(client.addPackage(args[0],eval(args[1]),eval(args[2]),)) - elif cmd == 'getPackageData': if len(args) != 1: print 'getPackageData requires 1 args' sys.exit(1) pp.pprint(client.getPackageData(eval(args[0]),)) -elif cmd == 'getFileData': - if len(args) != 1: - print 'getFileData requires 1 args' - sys.exit(1) - pp.pprint(client.getFileData(eval(args[0]),)) - -elif cmd == 'deleteFiles': +elif cmd == 'getPackageInfo': if len(args) != 1: - print 'deleteFiles requires 1 args' + print 'getPackageInfo requires 1 args' sys.exit(1) - pp.pprint(client.deleteFiles(eval(args[0]),)) + pp.pprint(client.getPackageInfo(eval(args[0]),)) -elif cmd == 'deletePackages': +elif cmd == 'getFileData': if len(args) != 1: - print 'deletePackages requires 1 args' + print 'getFileData requires 1 args' sys.exit(1) - pp.pprint(client.deletePackages(eval(args[0]),)) + pp.pprint(client.getFileData(eval(args[0]),)) elif cmd == 'getQueue': if len(args) != 0: @@ -318,12 +307,48 @@ elif cmd == 'getCollectorData': sys.exit(1) pp.pprint(client.getCollectorData()) +elif cmd == 'getPackageOrder': + if len(args) != 1: + print 'getPackageOrder requires 1 args' + sys.exit(1) + pp.pprint(client.getPackageOrder(eval(args[0]),)) + +elif cmd == 'getFileOrder': + if len(args) != 1: + print 'getFileOrder requires 1 args' + sys.exit(1) + pp.pprint(client.getFileOrder(eval(args[0]),)) + +elif cmd == 'addPackage': + if len(args) != 3: + print 'addPackage requires 3 args' + sys.exit(1) + pp.pprint(client.addPackage(args[0],eval(args[1]),eval(args[2]),)) + elif cmd == 'addFiles': if len(args) != 2: print 'addFiles requires 2 args' sys.exit(1) pp.pprint(client.addFiles(eval(args[0]),eval(args[1]),)) +elif cmd == 'uploadContainer': + if len(args) != 2: + print 'uploadContainer requires 2 args' + sys.exit(1) + pp.pprint(client.uploadContainer(args[0],args[1],)) + +elif cmd == 'deleteFiles': + if len(args) != 1: + print 'deleteFiles requires 1 args' + sys.exit(1) + pp.pprint(client.deleteFiles(eval(args[0]),)) + +elif cmd == 'deletePackages': + if len(args) != 1: + print 'deletePackages requires 1 args' + sys.exit(1) + pp.pprint(client.deletePackages(eval(args[0]),)) + elif cmd == 'pushToQueue': if len(args) != 1: print 'pushToQueue requires 1 args' @@ -378,12 +403,6 @@ elif cmd == 'movePackage': sys.exit(1) pp.pprint(client.movePackage(eval(args[0]),eval(args[1]),)) -elif cmd == 'uploadContainer': - if len(args) != 2: - print 'uploadContainer requires 2 args' - sys.exit(1) - pp.pprint(client.uploadContainer(args[0],args[1],)) - elif cmd == 'setPriority': if len(args) != 2: print 'setPriority requires 2 args' @@ -420,18 +439,6 @@ elif cmd == 'restartFailed': sys.exit(1) pp.pprint(client.restartFailed()) -elif cmd == 'getPackageOrder': - if len(args) != 1: - print 'getPackageOrder requires 1 args' - sys.exit(1) - pp.pprint(client.getPackageOrder(eval(args[0]),)) - -elif cmd == 'getFileOrder': - if len(args) != 1: - print 'getFileOrder requires 1 args' - sys.exit(1) - pp.pprint(client.getFileOrder(eval(args[0]),)) - elif cmd == 'isCaptchaWaiting': if len(args) != 0: print 'isCaptchaWaiting requires 0 args' diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index 187b7fa74..ec850b70c 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -109,16 +109,14 @@ class Iface(object): def statusDownloads(self, ): pass - def addPackage(self, name, links, dest): + def getPackageData(self, pid): """ Parameters: - - name - - links - - dest + - pid """ pass - def getPackageData(self, pid): + def getPackageInfo(self, pid): """ Parameters: - pid @@ -132,37 +130,68 @@ class Iface(object): """ pass - def deleteFiles(self, fids): + def getQueue(self, ): + pass + + def getCollector(self, ): + pass + + def getQueueData(self, ): + pass + + def getCollectorData(self, ): + pass + + def getPackageOrder(self, destination): """ Parameters: - - fids + - destination """ pass - def deletePackages(self, pids): + def getFileOrder(self, pid): """ Parameters: - - pids + - pid """ pass - def getQueue(self, ): + def addPackage(self, name, links, dest): + """ + Parameters: + - name + - links + - dest + """ pass - def getCollector(self, ): + def addFiles(self, pid, links): + """ + Parameters: + - pid + - links + """ pass - def getQueueData(self, ): + def uploadContainer(self, filename, data): + """ + Parameters: + - filename + - data + """ pass - def getCollectorData(self, ): + def deleteFiles(self, fids): + """ + Parameters: + - fids + """ pass - def addFiles(self, pid, links): + def deletePackages(self, pids): """ Parameters: - - pid - - links + - pids """ pass @@ -227,14 +256,6 @@ class Iface(object): """ pass - def uploadContainer(self, filename, data): - """ - Parameters: - - filename - - data - """ - pass - def setPriority(self, pid, priority): """ Parameters: @@ -273,20 +294,6 @@ class Iface(object): def restartFailed(self, ): pass - def getPackageOrder(self, destination): - """ - Parameters: - - destination - """ - pass - - def getFileOrder(self, pid): - """ - Parameters: - - pid - """ - pass - def isCaptchaWaiting(self, ): pass @@ -956,71 +963,69 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "statusDownloads failed: unknown result"); - def addPackage(self, name, links, dest): + def getPackageData(self, pid): """ Parameters: - - name - - links - - dest + - pid """ - self.send_addPackage(name, links, dest) - return self.recv_addPackage() + self.send_getPackageData(pid) + return self.recv_getPackageData() - def send_addPackage(self, name, links, dest): - self._oprot.writeMessageBegin('addPackage', TMessageType.CALL, self._seqid) - args = addPackage_args() - args.name = name - args.links = links - args.dest = dest + def send_getPackageData(self, pid): + self._oprot.writeMessageBegin('getPackageData', TMessageType.CALL, self._seqid) + args = getPackageData_args() + args.pid = pid args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_addPackage(self, ): + def recv_getPackageData(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = addPackage_result() + result = getPackageData_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "addPackage failed: unknown result"); + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageData failed: unknown result"); - def getPackageData(self, pid): + def getPackageInfo(self, pid): """ Parameters: - pid """ - self.send_getPackageData(pid) - return self.recv_getPackageData() + self.send_getPackageInfo(pid) + return self.recv_getPackageInfo() - def send_getPackageData(self, pid): - self._oprot.writeMessageBegin('getPackageData', TMessageType.CALL, self._seqid) - args = getPackageData_args() + def send_getPackageInfo(self, pid): + self._oprot.writeMessageBegin('getPackageInfo', TMessageType.CALL, self._seqid) + args = getPackageInfo_args() args.pid = pid args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getPackageData(self, ): + def recv_getPackageInfo(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getPackageData_result() + result = getPackageInfo_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success if result.e is not None: raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageData failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageInfo failed: unknown result"); def getFileData(self, fid): """ @@ -1054,62 +1059,6 @@ class Client(Iface): raise result.e raise TApplicationException(TApplicationException.MISSING_RESULT, "getFileData failed: unknown result"); - def deleteFiles(self, fids): - """ - Parameters: - - fids - """ - self.send_deleteFiles(fids) - self.recv_deleteFiles() - - def send_deleteFiles(self, fids): - self._oprot.writeMessageBegin('deleteFiles', TMessageType.CALL, self._seqid) - args = deleteFiles_args() - args.fids = fids - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_deleteFiles(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = deleteFiles_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - - def deletePackages(self, pids): - """ - Parameters: - - pids - """ - self.send_deletePackages(pids) - self.recv_deletePackages() - - def send_deletePackages(self, pids): - self._oprot.writeMessageBegin('deletePackages', TMessageType.CALL, self._seqid) - args = deletePackages_args() - args.pids = pids - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_deletePackages(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = deletePackages_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - def getQueue(self, ): self.send_getQueue() return self.recv_getQueue() @@ -1210,6 +1159,100 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getCollectorData failed: unknown result"); + def getPackageOrder(self, destination): + """ + Parameters: + - destination + """ + self.send_getPackageOrder(destination) + return self.recv_getPackageOrder() + + def send_getPackageOrder(self, destination): + self._oprot.writeMessageBegin('getPackageOrder', TMessageType.CALL, self._seqid) + args = getPackageOrder_args() + args.destination = destination + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getPackageOrder(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getPackageOrder_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageOrder failed: unknown result"); + + def getFileOrder(self, pid): + """ + Parameters: + - pid + """ + self.send_getFileOrder(pid) + return self.recv_getFileOrder() + + def send_getFileOrder(self, pid): + self._oprot.writeMessageBegin('getFileOrder', TMessageType.CALL, self._seqid) + args = getFileOrder_args() + args.pid = pid + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getFileOrder(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getFileOrder_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getFileOrder failed: unknown result"); + + def addPackage(self, name, links, dest): + """ + Parameters: + - name + - links + - dest + """ + self.send_addPackage(name, links, dest) + return self.recv_addPackage() + + def send_addPackage(self, name, links, dest): + self._oprot.writeMessageBegin('addPackage', TMessageType.CALL, self._seqid) + args = addPackage_args() + args.name = name + args.links = links + args.dest = dest + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_addPackage(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = addPackage_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "addPackage failed: unknown result"); + def addFiles(self, pid, links): """ Parameters: @@ -1240,6 +1283,92 @@ class Client(Iface): self._iprot.readMessageEnd() return + def uploadContainer(self, filename, data): + """ + Parameters: + - filename + - data + """ + self.send_uploadContainer(filename, data) + self.recv_uploadContainer() + + def send_uploadContainer(self, filename, data): + self._oprot.writeMessageBegin('uploadContainer', TMessageType.CALL, self._seqid) + args = uploadContainer_args() + args.filename = filename + args.data = data + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_uploadContainer(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = uploadContainer_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + def deleteFiles(self, fids): + """ + Parameters: + - fids + """ + self.send_deleteFiles(fids) + self.recv_deleteFiles() + + def send_deleteFiles(self, fids): + self._oprot.writeMessageBegin('deleteFiles', TMessageType.CALL, self._seqid) + args = deleteFiles_args() + args.fids = fids + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deleteFiles(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deleteFiles_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + def deletePackages(self, pids): + """ + Parameters: + - pids + """ + self.send_deletePackages(pids) + self.recv_deletePackages() + + def send_deletePackages(self, pids): + self._oprot.writeMessageBegin('deletePackages', TMessageType.CALL, self._seqid) + args = deletePackages_args() + args.pids = pids + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deletePackages(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deletePackages_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + def pushToQueue(self, pid): """ Parameters: @@ -1491,36 +1620,6 @@ class Client(Iface): self._iprot.readMessageEnd() return - def uploadContainer(self, filename, data): - """ - Parameters: - - filename - - data - """ - self.send_uploadContainer(filename, data) - self.recv_uploadContainer() - - def send_uploadContainer(self, filename, data): - self._oprot.writeMessageBegin('uploadContainer', TMessageType.CALL, self._seqid) - args = uploadContainer_args() - args.filename = filename - args.data = data - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_uploadContainer(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = uploadContainer_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - def setPriority(self, pid, priority): """ Parameters: @@ -1639,6 +1738,8 @@ class Client(Iface): result = setPackageData_result() result.read(self._iprot) self._iprot.readMessageEnd() + if result.e is not None: + raise result.e return def deleteFinished(self, ): @@ -1687,66 +1788,6 @@ class Client(Iface): self._iprot.readMessageEnd() return - def getPackageOrder(self, destination): - """ - Parameters: - - destination - """ - self.send_getPackageOrder(destination) - return self.recv_getPackageOrder() - - def send_getPackageOrder(self, destination): - self._oprot.writeMessageBegin('getPackageOrder', TMessageType.CALL, self._seqid) - args = getPackageOrder_args() - args.destination = destination - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getPackageOrder(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getPackageOrder_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageOrder failed: unknown result"); - - def getFileOrder(self, pid): - """ - Parameters: - - pid - """ - self.send_getFileOrder(pid) - return self.recv_getFileOrder() - - def send_getFileOrder(self, pid): - self._oprot.writeMessageBegin('getFileOrder', TMessageType.CALL, self._seqid) - args = getFileOrder_args() - args.pid = pid - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getFileOrder(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getFileOrder_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getFileOrder failed: unknown result"); - def isCaptchaWaiting(self, ): self.send_isCaptchaWaiting() return self.recv_isCaptchaWaiting() @@ -2241,16 +2282,20 @@ class Processor(Iface, TProcessor): self._processMap["checkOnlineStatus"] = Processor.process_checkOnlineStatus self._processMap["pollResults"] = Processor.process_pollResults self._processMap["statusDownloads"] = Processor.process_statusDownloads - self._processMap["addPackage"] = Processor.process_addPackage self._processMap["getPackageData"] = Processor.process_getPackageData + self._processMap["getPackageInfo"] = Processor.process_getPackageInfo self._processMap["getFileData"] = Processor.process_getFileData - self._processMap["deleteFiles"] = Processor.process_deleteFiles - 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["getPackageOrder"] = Processor.process_getPackageOrder + self._processMap["getFileOrder"] = Processor.process_getFileOrder + self._processMap["addPackage"] = Processor.process_addPackage self._processMap["addFiles"] = Processor.process_addFiles + self._processMap["uploadContainer"] = Processor.process_uploadContainer + self._processMap["deleteFiles"] = Processor.process_deleteFiles + self._processMap["deletePackages"] = Processor.process_deletePackages self._processMap["pushToQueue"] = Processor.process_pushToQueue self._processMap["pullFromQueue"] = Processor.process_pullFromQueue self._processMap["restartPackage"] = Processor.process_restartPackage @@ -2260,15 +2305,12 @@ class Processor(Iface, TProcessor): self._processMap["stopDownloads"] = Processor.process_stopDownloads self._processMap["setPackageName"] = Processor.process_setPackageName self._processMap["movePackage"] = Processor.process_movePackage - self._processMap["uploadContainer"] = Processor.process_uploadContainer self._processMap["setPriority"] = Processor.process_setPriority self._processMap["orderPackage"] = Processor.process_orderPackage self._processMap["orderFile"] = Processor.process_orderFile self._processMap["setPackageData"] = Processor.process_setPackageData self._processMap["deleteFinished"] = Processor.process_deleteFinished self._processMap["restartFailed"] = Processor.process_restartFailed - self._processMap["getPackageOrder"] = Processor.process_getPackageOrder - self._processMap["getFileOrder"] = Processor.process_getFileOrder self._processMap["isCaptchaWaiting"] = Processor.process_isCaptchaWaiting self._processMap["getCaptchaTask"] = Processor.process_getCaptchaTask self._processMap["getCaptchaTaskStatus"] = Processor.process_getCaptchaTaskStatus @@ -2532,27 +2574,30 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_addPackage(self, seqid, iprot, oprot): - args = addPackage_args() + def process_getPackageData(self, seqid, iprot, oprot): + args = getPackageData_args() args.read(iprot) iprot.readMessageEnd() - result = addPackage_result() - result.success = self._handler.addPackage(args.name, args.links, args.dest) - oprot.writeMessageBegin("addPackage", TMessageType.REPLY, seqid) + result = getPackageData_result() + try: + result.success = self._handler.getPackageData(args.pid) + except PackageDoesNotExists, e: + result.e = e + oprot.writeMessageBegin("getPackageData", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getPackageData(self, seqid, iprot, oprot): - args = getPackageData_args() + def process_getPackageInfo(self, seqid, iprot, oprot): + args = getPackageInfo_args() args.read(iprot) iprot.readMessageEnd() - result = getPackageData_result() + result = getPackageInfo_result() try: - result.success = self._handler.getPackageData(args.pid) + result.success = self._handler.getPackageInfo(args.pid) except PackageDoesNotExists, e: result.e = e - oprot.writeMessageBegin("getPackageData", TMessageType.REPLY, seqid) + oprot.writeMessageBegin("getPackageInfo", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2571,28 +2616,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_deleteFiles(self, seqid, iprot, oprot): - args = deleteFiles_args() - args.read(iprot) - iprot.readMessageEnd() - result = deleteFiles_result() - self._handler.deleteFiles(args.fids) - oprot.writeMessageBegin("deleteFiles", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_deletePackages(self, seqid, iprot, oprot): - args = deletePackages_args() - args.read(iprot) - iprot.readMessageEnd() - result = deletePackages_result() - self._handler.deletePackages(args.pids) - oprot.writeMessageBegin("deletePackages", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_getQueue(self, seqid, iprot, oprot): args = getQueue_args() args.read(iprot) @@ -2637,6 +2660,39 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_getPackageOrder(self, seqid, iprot, oprot): + args = getPackageOrder_args() + args.read(iprot) + iprot.readMessageEnd() + result = getPackageOrder_result() + result.success = self._handler.getPackageOrder(args.destination) + oprot.writeMessageBegin("getPackageOrder", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getFileOrder(self, seqid, iprot, oprot): + args = getFileOrder_args() + args.read(iprot) + iprot.readMessageEnd() + result = getFileOrder_result() + result.success = self._handler.getFileOrder(args.pid) + oprot.writeMessageBegin("getFileOrder", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_addPackage(self, seqid, iprot, oprot): + args = addPackage_args() + args.read(iprot) + iprot.readMessageEnd() + result = addPackage_result() + result.success = self._handler.addPackage(args.name, args.links, args.dest) + oprot.writeMessageBegin("addPackage", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_addFiles(self, seqid, iprot, oprot): args = addFiles_args() args.read(iprot) @@ -2648,6 +2704,39 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_uploadContainer(self, seqid, iprot, oprot): + args = uploadContainer_args() + args.read(iprot) + iprot.readMessageEnd() + result = uploadContainer_result() + self._handler.uploadContainer(args.filename, args.data) + oprot.writeMessageBegin("uploadContainer", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deleteFiles(self, seqid, iprot, oprot): + args = deleteFiles_args() + args.read(iprot) + iprot.readMessageEnd() + result = deleteFiles_result() + self._handler.deleteFiles(args.fids) + oprot.writeMessageBegin("deleteFiles", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deletePackages(self, seqid, iprot, oprot): + args = deletePackages_args() + args.read(iprot) + iprot.readMessageEnd() + result = deletePackages_result() + self._handler.deletePackages(args.pids) + oprot.writeMessageBegin("deletePackages", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_pushToQueue(self, seqid, iprot, oprot): args = pushToQueue_args() args.read(iprot) @@ -2747,17 +2836,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_uploadContainer(self, seqid, iprot, oprot): - args = uploadContainer_args() - args.read(iprot) - iprot.readMessageEnd() - result = uploadContainer_result() - self._handler.uploadContainer(args.filename, args.data) - oprot.writeMessageBegin("uploadContainer", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_setPriority(self, seqid, iprot, oprot): args = setPriority_args() args.read(iprot) @@ -2796,7 +2874,10 @@ class Processor(Iface, TProcessor): args.read(iprot) iprot.readMessageEnd() result = setPackageData_result() - self._handler.setPackageData(args.pid, args.data) + try: + self._handler.setPackageData(args.pid, args.data) + except PackageDoesNotExists, e: + result.e = e oprot.writeMessageBegin("setPackageData", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() @@ -2824,28 +2905,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_getPackageOrder(self, seqid, iprot, oprot): - args = getPackageOrder_args() - args.read(iprot) - iprot.readMessageEnd() - result = getPackageOrder_result() - result.success = self._handler.getPackageOrder(args.destination) - oprot.writeMessageBegin("getPackageOrder", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_getFileOrder(self, seqid, iprot, oprot): - args = getFileOrder_args() - args.read(iprot) - iprot.readMessageEnd() - result = getFileOrder_result() - result.success = self._handler.getFileOrder(args.pid) - oprot.writeMessageBegin("getFileOrder", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_isCaptchaWaiting(self, seqid, iprot, oprot): args = isCaptchaWaiting_args() args.read(iprot) @@ -3642,52 +3701,48 @@ class statusDownloads_result(TBase): self.success = success -class addPackage_args(TBase): +class getPackageData_args(TBase): """ Attributes: - - name - - links - - dest + - pid """ __slots__ = [ - 'name', - 'links', - 'dest', + 'pid', ] thrift_spec = ( None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.LIST, 'links', (TType.STRING,None), None, ), # 2 - (3, TType.I32, 'dest', None, None, ), # 3 + (1, TType.I32, 'pid', None, None, ), # 1 ) - def __init__(self, name=None, links=None, dest=None,): - self.name = name - self.links = links - self.dest = dest + def __init__(self, pid=None,): + self.pid = pid -class addPackage_result(TBase): +class getPackageData_result(TBase): """ Attributes: - success + - e """ __slots__ = [ 'success', + 'e', ] thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 + (0, TType.STRUCT, 'success', (PackageData, PackageData.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None, ), # 1 ) - def __init__(self, success=None,): + def __init__(self, success=None, e=None,): self.success = success + self.e = e -class getPackageData_args(TBase): +class getPackageInfo_args(TBase): """ Attributes: - pid @@ -3706,7 +3761,7 @@ class getPackageData_args(TBase): self.pid = pid -class getPackageData_result(TBase): +class getPackageInfo_result(TBase): """ Attributes: - success @@ -3769,26 +3824,34 @@ class getFileData_result(TBase): self.e = e -class deleteFiles_args(TBase): +class getQueue_args(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class getQueue_result(TBase): """ Attributes: - - fids + - success """ __slots__ = [ - 'fids', + 'success', ] thrift_spec = ( - None, # 0 - (1, TType.LIST, 'fids', (TType.I32,None), None, ), # 1 + (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 ) - def __init__(self, fids=None,): - self.fids = fids + def __init__(self, success=None,): + self.success = success -class deleteFiles_result(TBase): +class getCollector_args(TBase): __slots__ = [ ] @@ -3797,26 +3860,25 @@ class deleteFiles_result(TBase): ) -class deletePackages_args(TBase): +class getCollector_result(TBase): """ Attributes: - - pids + - success """ __slots__ = [ - 'pids', + 'success', ] thrift_spec = ( - None, # 0 - (1, TType.LIST, 'pids', (TType.I32,None), None, ), # 1 + (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 ) - def __init__(self, pids=None,): - self.pids = pids + def __init__(self, success=None,): + self.success = success -class deletePackages_result(TBase): +class getQueueData_args(TBase): __slots__ = [ ] @@ -3825,16 +3887,34 @@ class deletePackages_result(TBase): ) -class getQueue_args(TBase): +class getQueueData_result(TBase): + """ + Attributes: + - success + """ __slots__ = [ + 'success', ] thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 ) + def __init__(self, success=None,): + self.success = success -class getQueue_result(TBase): + +class getCollectorData_args(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class getCollectorData_result(TBase): """ Attributes: - success @@ -3845,23 +3925,33 @@ class getQueue_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageInfo, PackageInfo.thrift_spec)), None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class getCollector_args(TBase): +class getPackageOrder_args(TBase): + """ + Attributes: + - destination + """ __slots__ = [ + 'destination', ] thrift_spec = ( + None, # 0 + (1, TType.I32, 'destination', None, None, ), # 1 ) + def __init__(self, destination=None,): + self.destination = destination -class getCollector_result(TBase): + +class getPackageOrder_result(TBase): """ Attributes: - success @@ -3872,23 +3962,33 @@ class getCollector_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageInfo, PackageInfo.thrift_spec)), None, ), # 0 + (0, TType.MAP, 'success', (TType.I16,None,TType.I32,None), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class getQueueData_args(TBase): +class getFileOrder_args(TBase): + """ + Attributes: + - pid + """ __slots__ = [ + 'pid', ] thrift_spec = ( + None, # 0 + (1, TType.I32, 'pid', None, None, ), # 1 ) + def __init__(self, pid=None,): + self.pid = pid -class getQueueData_result(TBase): + +class getFileOrder_result(TBase): """ Attributes: - success @@ -3899,23 +3999,41 @@ class getQueueData_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + (0, TType.MAP, 'success', (TType.I16,None,TType.I32,None), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class getCollectorData_args(TBase): +class addPackage_args(TBase): + """ + Attributes: + - name + - links + - dest + """ __slots__ = [ + 'name', + 'links', + 'dest', ] thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.LIST, 'links', (TType.STRING,None), None, ), # 2 + (3, TType.I32, 'dest', None, None, ), # 3 ) + def __init__(self, name=None, links=None, dest=None,): + self.name = name + self.links = links + self.dest = dest + -class getCollectorData_result(TBase): +class addPackage_result(TBase): """ Attributes: - success @@ -3926,7 +4044,7 @@ class getCollectorData_result(TBase): ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(PackageData, PackageData.thrift_spec)), None, ), # 0 + (0, TType.I32, 'success', None, None, ), # 0 ) def __init__(self, success=None,): @@ -3965,6 +4083,94 @@ class addFiles_result(TBase): ) +class uploadContainer_args(TBase): + """ + Attributes: + - filename + - data + """ + + __slots__ = [ + 'filename', + 'data', + ] + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'filename', None, None, ), # 1 + (2, TType.STRING, 'data', None, None, ), # 2 + ) + + def __init__(self, filename=None, data=None,): + self.filename = filename + self.data = data + + +class uploadContainer_result(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class deleteFiles_args(TBase): + """ + Attributes: + - fids + """ + + __slots__ = [ + 'fids', + ] + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'fids', (TType.I32,None), None, ), # 1 + ) + + def __init__(self, fids=None,): + self.fids = fids + + +class deleteFiles_result(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class deletePackages_args(TBase): + """ + Attributes: + - pids + """ + + __slots__ = [ + 'pids', + ] + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'pids', (TType.I32,None), None, ), # 1 + ) + + def __init__(self, pids=None,): + self.pids = pids + + +class deletePackages_result(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + class pushToQueue_args(TBase): """ Attributes: @@ -4215,38 +4421,6 @@ class movePackage_result(TBase): ) -class uploadContainer_args(TBase): - """ - Attributes: - - filename - - data - """ - - __slots__ = [ - 'filename', - 'data', - ] - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'filename', None, None, ), # 1 - (2, TType.STRING, 'data', None, None, ), # 2 - ) - - def __init__(self, filename=None, data=None,): - self.filename = filename - self.data = data - - -class uploadContainer_result(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - class setPriority_args(TBase): """ Attributes: @@ -4367,13 +4541,23 @@ class setPackageData_args(TBase): class setPackageData_result(TBase): + """ + Attributes: + - e + """ __slots__ = [ + 'e', ] thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None, ), # 1 ) + def __init__(self, e=None,): + self.e = e + class deleteFinished_args(TBase): @@ -4411,80 +4595,6 @@ class restartFailed_result(TBase): ) -class getPackageOrder_args(TBase): - """ - Attributes: - - destination - """ - - __slots__ = [ - 'destination', - ] - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'destination', None, None, ), # 1 - ) - - def __init__(self, destination=None,): - self.destination = destination - - -class getPackageOrder_result(TBase): - """ - Attributes: - - success - """ - - __slots__ = [ - 'success', - ] - - thrift_spec = ( - (0, TType.MAP, 'success', (TType.I16,None,TType.I32,None), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - -class getFileOrder_args(TBase): - """ - Attributes: - - pid - """ - - __slots__ = [ - 'pid', - ] - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - ) - - def __init__(self, pid=None,): - self.pid = pid - - -class getFileOrder_result(TBase): - """ - Attributes: - - success - """ - - __slots__ = [ - 'success', - ] - - thrift_spec = ( - (0, TType.MAP, 'success', (TType.I16,None,TType.I32,None), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - class isCaptchaWaiting_args(TBase): __slots__ = [ diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index 0b456cc55..da8a2477e 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -65,17 +65,17 @@ class DownloadStatus(TBase): } class Destination(TBase): - Queue = 0 - Collector = 1 + Collector = 0 + Queue = 1 _VALUES_TO_NAMES = { - 0: "Queue", - 1: "Collector", + 0: "Collector", + 1: "Queue", } _NAMES_TO_VALUES = { - "Queue": 0, - "Collector": 1, + "Collector": 0, + "Queue": 1, } class ElementType(TBase): @@ -200,7 +200,7 @@ class ServerStatus(TBase): (2, TType.I16, 'active', None, None, ), # 2 (3, TType.I16, 'queue', None, None, ), # 3 (4, TType.I16, 'total', None, None, ), # 4 - (5, TType.I32, 'speed', None, None, ), # 5 + (5, TType.I64, 'speed', None, None, ), # 5 (6, TType.BOOL, 'download', None, None, ), # 6 (7, TType.BOOL, 'reconnect', None, None, ), # 7 ) @@ -347,6 +347,7 @@ class PackageData(TBase): - dest - order - priority + - fids - links """ @@ -359,6 +360,7 @@ class PackageData(TBase): 'dest', 'order', 'priority', + 'fids', 'links', ] @@ -372,61 +374,11 @@ class PackageData(TBase): (6, TType.I32, 'dest', None, None, ), # 6 (7, TType.I16, 'order', None, None, ), # 7 (8, TType.BYTE, 'priority', None, None, ), # 8 - (9, TType.LIST, 'links', (TType.STRUCT,(FileData, FileData.thrift_spec)), None, ), # 9 + (9, TType.LIST, 'fids', (TType.I32,None), None, ), # 9 + (10, TType.LIST, 'links', (TType.STRUCT,(FileData, FileData.thrift_spec)), None, ), # 10 ) - def __init__(self, pid=None, name=None, folder=None, site=None, password=None, dest=None, order=None, priority=None, links=None,): - self.pid = pid - self.name = name - self.folder = folder - self.site = site - self.password = password - self.dest = dest - self.order = order - self.priority = priority - self.links = links - - -class PackageInfo(TBase): - """ - Attributes: - - pid - - name - - folder - - site - - password - - dest - - order - - priority - - links - """ - - __slots__ = [ - 'pid', - 'name', - 'folder', - 'site', - 'password', - 'dest', - 'order', - 'priority', - 'links', - ] - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'pid', None, None, ), # 1 - (2, TType.STRING, 'name', None, None, ), # 2 - (3, TType.STRING, 'folder', None, None, ), # 3 - (4, TType.STRING, 'site', None, None, ), # 4 - (5, TType.STRING, 'password', None, None, ), # 5 - (6, TType.I32, 'dest', None, None, ), # 6 - (7, TType.I16, 'order', None, None, ), # 7 - (8, TType.BYTE, 'priority', None, None, ), # 8 - (9, TType.LIST, 'links', (TType.I32,None), None, ), # 9 - ) - - def __init__(self, pid=None, name=None, folder=None, site=None, password=None, dest=None, order=None, priority=None, links=None,): + def __init__(self, pid=None, name=None, folder=None, site=None, password=None, dest=None, order=None, priority=None, fids=None, links=None,): self.pid = pid self.name = name self.folder = folder @@ -435,6 +387,7 @@ class PackageInfo(TBase): self.dest = dest self.order = order self.priority = priority + self.fids = fids self.links = links |