diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-06-03 17:45:10 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-06-03 17:45:10 +0200 |
commit | 0d2d6daef850ac6bcc7fafccd230e52d2a862c2c (patch) | |
tree | 73e36baba63e4c0895149bab9fe698d32f405828 /module/remote | |
parent | small typo fixes and TODOs (diff) | |
download | pyload-0d2d6daef850ac6bcc7fafccd230e52d2a862c2c.tar.xz |
updates for database + api
Diffstat (limited to 'module/remote')
-rw-r--r-- | module/remote/socketbackend/ttypes.py | 35 | ||||
-rw-r--r-- | module/remote/thriftbackend/pyload.thrift | 64 | ||||
-rwxr-xr-x | module/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 119 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/Pyload.py | 1129 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/ttypes.py | 115 |
5 files changed, 719 insertions, 743 deletions
diff --git a/module/remote/socketbackend/ttypes.py b/module/remote/socketbackend/ttypes.py index 127098ec3..b7e0d7f3d 100644 --- a/module/remote/socketbackend/ttypes.py +++ b/module/remote/socketbackend/ttypes.py @@ -63,16 +63,15 @@ class PackageStatus: Remote = 2 class Permission: - Accounts = 128 + Accounts = 32 Add = 1 - Addons = 512 + Addons = 128 All = 0 Delete = 2 - Download = 64 - Interaction = 256 - List = 16 - Modify = 32 - Status = 4 + Download = 16 + Interaction = 64 + Modify = 4 + Status = 8 class Role: Admin = 0 @@ -103,13 +102,13 @@ class AddonInfo(BaseObject): self.value = value class AddonService(BaseObject): - __slots__ = ['func_name', 'description', 'media', 'package'] + __slots__ = ['func_name', 'description', 'arguments', 'media'] - def __init__(self, func_name=None, description=None, media=None, package=None): + def __init__(self, func_name=None, description=None, arguments=None, media=None): self.func_name = func_name self.description = description + self.arguments = arguments self.media = media - self.package = package class ConfigItem(BaseObject): __slots__ = ['name', 'display_name', 'description', 'type', 'default_value', 'value'] @@ -293,9 +292,9 @@ class ServiceException(Exception): self.msg = msg class UserData(BaseObject): - __slots__ = ['uid', 'name', 'email', 'role', 'permission', 'folder', 'traffic', 'dllimit', 'user', 'templateName'] + __slots__ = ['uid', 'name', 'email', 'role', 'permission', 'folder', 'traffic', 'dllimit', 'dlquota', 'hddquota', 'user', 'templateName'] - def __init__(self, uid=None, name=None, email=None, role=None, permission=None, folder=None, traffic=None, dllimit=None, user=None, templateName=None): + def __init__(self, uid=None, name=None, email=None, role=None, permission=None, folder=None, traffic=None, dllimit=None, dlquota=None, hddquota=None, user=None, templateName=None): self.uid = uid self.name = name self.email = email @@ -304,6 +303,8 @@ class UserData(BaseObject): self.folder = folder self.traffic = traffic self.dllimit = dllimit + self.dlquota = dlquota + self.hddquota = hddquota self.user = user self.templateName = templateName @@ -318,6 +319,8 @@ class Iface: pass def addLinks(self, pid, links): pass + def addLocalFile(self, pid, name, path): + pass def addPackage(self, name, links, password): pass def addPackageChild(self, name, links, password, root, paused): @@ -328,9 +331,7 @@ class Iface: pass def addUser(self, username, password): pass - def autoAddLinks(self, links): - pass - def call(self, plugin, func, arguments): + def callAddon(self, plugin, func, arguments): pass def callAddonHandler(self, plugin, func, pid_or_fid): pass @@ -406,13 +407,11 @@ class Iface: pass def getServerVersion(self): pass - def getServices(self): - pass def getUnfinishedFileTree(self, pid, full): pass def getUserData(self): pass - def hasService(self, plugin, func): + def hasAddonHandler(self, plugin, func): pass def isInteractionWaiting(self, mode): pass diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index 181ca4204..e0fa9c040 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -201,6 +201,13 @@ struct InteractionTask { 8: PluginName plugin, } +struct AddonService { + 1: string func_name, + 2: string description, + 3: list<string> arguments, + 4: optional i16 media, +} + struct AddonInfo { 1: string func_name, 2: string description, @@ -228,7 +235,7 @@ struct ConfigSection { struct EventInfo { 1: string eventname, - 2: list<string> event_args, + 2: list<JSONString> event_args, } struct UserData { @@ -240,8 +247,10 @@ struct UserData { 6: string folder, 7: ByteCount traffic 8: i16 dllimit - 9: UserID user - 10: string templateName + 9: string dlquota, + 10: ByteCount hddquota, + 11: UserID user + 12: string templateName } struct AccountInfo { @@ -258,13 +267,6 @@ struct AccountInfo { 11: map<string, string> options, } -struct AddonService { - 1: string func_name, - 2: string description, - 3: optional i16 media, - 4: optional bool package, -} - struct OnlineCheck { 1: ResultID rid, // -1 -> nothing more to get 2: map<string, LinkStatus> data, // url to result @@ -313,9 +315,6 @@ service Pyload { bool toggleReconnect(), void scanDownloadFolder(), - // downloads - information - list<ProgressInfo> getProgressInfo(), - /////////////////////// // Configuration /////////////////////// @@ -333,7 +332,6 @@ service Pyload { map<PluginName, LinkList> checkURLs(1: LinkList urls), map<PluginName, LinkList> parseURLs(1: string html, 2: string url), - // packagename - urls // parses results and generates packages OnlineCheck checkOnlineStatus(1: LinkList urls), @@ -342,6 +340,7 @@ service Pyload { // poll results from previously started online check OnlineCheck pollResults(1: ResultID rid), + // packagename -> urls map<string, LinkList> generatePackages(1: LinkList links), /////////////////////// @@ -349,7 +348,6 @@ service Pyload { /////////////////////// list<PackageID> generateAndAddPackages(1: LinkList links, 2: bool paused), - list<FileID> autoAddLinks(1: LinkList links), PackageID createPackage(1: string name, 2: string folder, 3: PackageID root, 4: string password, 5: string site, 6: string comment, 7: bool paused), @@ -364,10 +362,11 @@ service Pyload { PackageID uploadContainer(1: string filename, 2: binary data), void addLinks(1: PackageID pid, 2: LinkList links) throws (1: PackageDoesNotExists e), + void addLocalFile(1: PackageID pid, 2: string name, 3: string path) throws (1: PackageDoesNotExists e) // these are real file operations and WILL delete files on disk void deleteFiles(1: list<FileID> fids), - void deletePackages(1: list<PackageID> pids), + void deletePackages(1: list<PackageID> pids), // delete the whole folder recursive /////////////////////// // Collector @@ -406,8 +405,6 @@ service Pyload { void restartPackage(1: PackageID pid), void restartFile(1: FileID fid), void recheckPackage(1: PackageID pid), - void stopDownloads(1: list<FileID> fids), - void stopAllDownloads(), void restartFailed(), ///////////////////////// @@ -429,6 +426,17 @@ service Pyload { void orderFiles(1: list<FileID> fids, 2: PackageID pid, 3: i16 position), /////////////////////// + // Taks/Progress + /////////////////////// + + // downloads - information + list<ProgressInfo> getProgressInfo(), + void stopDownloads(1: list<FileID> fids), + void stopAllDownloads(), + + // TODO - progress methods and data type + + /////////////////////// // User Interaction /////////////////////// @@ -442,9 +450,6 @@ service Pyload { list<InteractionTask> getNotifications(), - map<PluginName, list<AddonService>> getAddonHandler(), - void callAddonHandler(1: PluginName plugin, 2: string func, 3: PackageID pid_or_fid), - /////////////////////// // Event Handling /////////////////////// @@ -484,15 +489,20 @@ service Pyload { // Addon Methods /////////////////////// - map<PluginName, list<AddonService>> getServices(), - bool hasService(1: PluginName plugin, 2: string func), - - // empty string or json encoded list as args - string call(1: PluginName plugin, 2: string func, 3: JSONString arguments) throws (1: ServiceDoesNotExists ex, 2: ServiceException e), - map<PluginName, list<AddonInfo>> getAllInfo(), list<AddonInfo> getInfoByPlugin(1: PluginName plugin), + map<PluginName, list<AddonService>> getAddonHandler(), + bool hasAddonHandler(1: PluginName plugin, 2: string func), + + void callAddon(1: PluginName plugin, 2: string func, 3: list<JSONString> arguments) + throws (1: ServiceDoesNotExists e, 2: ServiceException ex), + + // special variant of callAddon that works on the media types, acccepting integer + void callAddonHandler(1: PluginName plugin, 2: string func, 3: PackageID pid_or_fid) + throws (1: ServiceDoesNotExists e, 2: ServiceException ex), + + //scheduler // TODO diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index c2c13d8ed..5b4a6fc75 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -36,7 +36,6 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' bool isTimeReconnect()' print ' bool toggleReconnect()' print ' void scanDownloadFolder()' - print ' getProgressInfo()' print ' string getConfigValue(string section, string option)' print ' void setConfigValue(string section, string option, string value)' print ' getConfig()' @@ -50,13 +49,13 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' OnlineCheck pollResults(ResultID rid)' print ' generatePackages(LinkList links)' print ' generateAndAddPackages(LinkList links, bool paused)' - print ' autoAddLinks(LinkList links)' print ' PackageID createPackage(string name, string folder, PackageID root, string password, string site, string comment, bool paused)' print ' PackageID addPackage(string name, LinkList links, string password)' print ' PackageID addPackageP(string name, LinkList links, string password, bool paused)' print ' PackageID addPackageChild(string name, LinkList links, string password, PackageID root, bool paused)' print ' PackageID uploadContainer(string filename, string data)' print ' void addLinks(PackageID pid, LinkList links)' + print ' void addLocalFile(PackageID pid, string name, string path)' print ' void deleteFiles( fids)' print ' void deletePackages( pids)' print ' getCollector()' @@ -76,8 +75,6 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void restartPackage(PackageID pid)' print ' void restartFile(FileID fid)' print ' void recheckPackage(PackageID pid)' - print ' void stopDownloads( fids)' - print ' void stopAllDownloads()' print ' void restartFailed()' print ' void setFilePaused(FileID fid, bool paused)' print ' void setPackagePaused(PackageID pid, bool paused)' @@ -87,13 +84,14 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' bool moveFiles( fids, PackageID pid)' print ' void orderPackage( pids, i16 position)' print ' void orderFiles( fids, PackageID pid, i16 position)' + print ' getProgressInfo()' + print ' void stopDownloads( fids)' + print ' void stopAllDownloads()' print ' bool isInteractionWaiting(i16 mode)' print ' InteractionTask getInteractionTask(i16 mode)' print ' void setInteractionResult(InteractionID iid, JSONString result)' print ' string generateDownloadLink(FileID fid, i16 timeout)' print ' getNotifications()' - print ' getAddonHandler()' - print ' void callAddonHandler(PluginName plugin, string func, PackageID pid_or_fid)' print ' getEvents(string uuid)' print ' getAccounts(bool refresh)' print ' getAccountTypes()' @@ -106,11 +104,12 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' void updateUserData(UserData data)' print ' void removeUser(UserID uid)' print ' bool setPassword(string username, string old_password, string new_password)' - print ' getServices()' - print ' bool hasService(PluginName plugin, string func)' - print ' string call(PluginName plugin, string func, JSONString arguments)' print ' getAllInfo()' print ' getInfoByPlugin(PluginName plugin)' + print ' getAddonHandler()' + print ' bool hasAddonHandler(PluginName plugin, string func)' + print ' void callAddon(PluginName plugin, string func, arguments)' + print ' void callAddonHandler(PluginName plugin, string func, PackageID pid_or_fid)' print '' sys.exit(0) @@ -240,12 +239,6 @@ elif cmd == 'scanDownloadFolder': sys.exit(1) pp.pprint(client.scanDownloadFolder()) -elif cmd == 'getProgressInfo': - if len(args) != 0: - print 'getProgressInfo requires 0 args' - sys.exit(1) - pp.pprint(client.getProgressInfo()) - elif cmd == 'getConfigValue': if len(args) != 2: print 'getConfigValue requires 2 args' @@ -324,12 +317,6 @@ elif cmd == 'generateAndAddPackages': sys.exit(1) pp.pprint(client.generateAndAddPackages(eval(args[0]),eval(args[1]),)) -elif cmd == 'autoAddLinks': - if len(args) != 1: - print 'autoAddLinks requires 1 args' - sys.exit(1) - pp.pprint(client.autoAddLinks(eval(args[0]),)) - elif cmd == 'createPackage': if len(args) != 7: print 'createPackage requires 7 args' @@ -366,6 +353,12 @@ elif cmd == 'addLinks': sys.exit(1) pp.pprint(client.addLinks(eval(args[0]),eval(args[1]),)) +elif cmd == 'addLocalFile': + if len(args) != 3: + print 'addLocalFile requires 3 args' + sys.exit(1) + pp.pprint(client.addLocalFile(eval(args[0]),args[1],args[2],)) + elif cmd == 'deleteFiles': if len(args) != 1: print 'deleteFiles requires 1 args' @@ -480,18 +473,6 @@ elif cmd == 'recheckPackage': sys.exit(1) pp.pprint(client.recheckPackage(eval(args[0]),)) -elif cmd == 'stopDownloads': - if len(args) != 1: - print 'stopDownloads requires 1 args' - sys.exit(1) - pp.pprint(client.stopDownloads(eval(args[0]),)) - -elif cmd == 'stopAllDownloads': - if len(args) != 0: - print 'stopAllDownloads requires 0 args' - sys.exit(1) - pp.pprint(client.stopAllDownloads()) - elif cmd == 'restartFailed': if len(args) != 0: print 'restartFailed requires 0 args' @@ -546,6 +527,24 @@ elif cmd == 'orderFiles': sys.exit(1) pp.pprint(client.orderFiles(eval(args[0]),eval(args[1]),eval(args[2]),)) +elif cmd == 'getProgressInfo': + if len(args) != 0: + print 'getProgressInfo requires 0 args' + sys.exit(1) + pp.pprint(client.getProgressInfo()) + +elif cmd == 'stopDownloads': + if len(args) != 1: + print 'stopDownloads requires 1 args' + sys.exit(1) + pp.pprint(client.stopDownloads(eval(args[0]),)) + +elif cmd == 'stopAllDownloads': + if len(args) != 0: + print 'stopAllDownloads requires 0 args' + sys.exit(1) + pp.pprint(client.stopAllDownloads()) + elif cmd == 'isInteractionWaiting': if len(args) != 1: print 'isInteractionWaiting requires 1 args' @@ -576,18 +575,6 @@ elif cmd == 'getNotifications': sys.exit(1) pp.pprint(client.getNotifications()) -elif cmd == 'getAddonHandler': - if len(args) != 0: - print 'getAddonHandler requires 0 args' - sys.exit(1) - pp.pprint(client.getAddonHandler()) - -elif cmd == 'callAddonHandler': - if len(args) != 3: - print 'callAddonHandler requires 3 args' - sys.exit(1) - pp.pprint(client.callAddonHandler(eval(args[0]),args[1],eval(args[2]),)) - elif cmd == 'getEvents': if len(args) != 1: print 'getEvents requires 1 args' @@ -660,24 +647,6 @@ elif cmd == 'setPassword': sys.exit(1) pp.pprint(client.setPassword(args[0],args[1],args[2],)) -elif cmd == 'getServices': - if len(args) != 0: - print 'getServices requires 0 args' - sys.exit(1) - pp.pprint(client.getServices()) - -elif cmd == 'hasService': - if len(args) != 2: - print 'hasService requires 2 args' - sys.exit(1) - pp.pprint(client.hasService(eval(args[0]),args[1],)) - -elif cmd == 'call': - if len(args) != 3: - print 'call requires 3 args' - sys.exit(1) - pp.pprint(client.call(eval(args[0]),args[1],eval(args[2]),)) - elif cmd == 'getAllInfo': if len(args) != 0: print 'getAllInfo requires 0 args' @@ -690,6 +659,30 @@ elif cmd == 'getInfoByPlugin': sys.exit(1) pp.pprint(client.getInfoByPlugin(eval(args[0]),)) +elif cmd == 'getAddonHandler': + if len(args) != 0: + print 'getAddonHandler requires 0 args' + sys.exit(1) + pp.pprint(client.getAddonHandler()) + +elif cmd == 'hasAddonHandler': + if len(args) != 2: + print 'hasAddonHandler requires 2 args' + sys.exit(1) + pp.pprint(client.hasAddonHandler(eval(args[0]),args[1],)) + +elif cmd == 'callAddon': + if len(args) != 3: + print 'callAddon requires 3 args' + sys.exit(1) + pp.pprint(client.callAddon(eval(args[0]),args[1],eval(args[2]),)) + +elif cmd == 'callAddonHandler': + if len(args) != 3: + print 'callAddonHandler requires 3 args' + sys.exit(1) + pp.pprint(client.callAddonHandler(eval(args[0]),args[1],eval(args[2]),)) + else: print 'Unrecognized method %s' % cmd sys.exit(1) diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index dd446cfc3..ba5d8cadc 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -56,9 +56,6 @@ class Iface(object): def scanDownloadFolder(self, ): pass - def getProgressInfo(self, ): - pass - def getConfigValue(self, section, option): """ Parameters: @@ -151,13 +148,6 @@ class Iface(object): """ pass - def autoAddLinks(self, links): - """ - Parameters: - - links - """ - pass - def createPackage(self, name, folder, root, password, site, comment, paused): """ Parameters: @@ -217,6 +207,15 @@ class Iface(object): """ pass + def addLocalFile(self, pid, name, path): + """ + Parameters: + - pid + - name + - path + """ + pass + def deleteFiles(self, fids): """ Parameters: @@ -342,16 +341,6 @@ class Iface(object): """ pass - def stopDownloads(self, fids): - """ - Parameters: - - fids - """ - pass - - def stopAllDownloads(self, ): - pass - def restartFailed(self, ): pass @@ -420,6 +409,19 @@ class Iface(object): """ pass + def getProgressInfo(self, ): + pass + + def stopDownloads(self, fids): + """ + Parameters: + - fids + """ + pass + + def stopAllDownloads(self, ): + pass + def isInteractionWaiting(self, mode): """ Parameters: @@ -453,18 +455,6 @@ class Iface(object): def getNotifications(self, ): pass - def getAddonHandler(self, ): - pass - - def callAddonHandler(self, plugin, func, pid_or_fid): - """ - Parameters: - - plugin - - func - - pid_or_fid - """ - pass - def getEvents(self, uuid): """ Parameters: @@ -545,33 +535,42 @@ class Iface(object): """ pass - def getServices(self, ): + def getAllInfo(self, ): pass - def hasService(self, plugin, func): + def getInfoByPlugin(self, plugin): """ Parameters: - plugin - - func """ pass - def call(self, plugin, func, arguments): + def getAddonHandler(self, ): + pass + + def hasAddonHandler(self, plugin, func): """ Parameters: - plugin - func - - arguments """ pass - def getAllInfo(self, ): + def callAddon(self, plugin, func, arguments): + """ + Parameters: + - plugin + - func + - arguments + """ pass - def getInfoByPlugin(self, plugin): + def callAddonHandler(self, plugin, func, pid_or_fid): """ Parameters: - plugin + - func + - pid_or_fid """ pass @@ -903,31 +902,6 @@ class Client(Iface): self._iprot.readMessageEnd() return - def getProgressInfo(self, ): - self.send_getProgressInfo() - return self.recv_getProgressInfo() - - def send_getProgressInfo(self, ): - self._oprot.writeMessageBegin('getProgressInfo', TMessageType.CALL, self._seqid) - args = getProgressInfo_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getProgressInfo(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getProgressInfo_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getProgressInfo failed: unknown result"); - def getConfigValue(self, section, option): """ Parameters: @@ -1322,36 +1296,6 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generateAndAddPackages failed: unknown result"); - def autoAddLinks(self, links): - """ - Parameters: - - links - """ - self.send_autoAddLinks(links) - return self.recv_autoAddLinks() - - def send_autoAddLinks(self, links): - self._oprot.writeMessageBegin('autoAddLinks', TMessageType.CALL, self._seqid) - args = autoAddLinks_args() - args.links = links - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_autoAddLinks(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = autoAddLinks_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "autoAddLinks failed: unknown result"); - def createPackage(self, name, folder, root, password, site, comment, paused): """ Parameters: @@ -1566,6 +1510,40 @@ class Client(Iface): raise result.e return + def addLocalFile(self, pid, name, path): + """ + Parameters: + - pid + - name + - path + """ + self.send_addLocalFile(pid, name, path) + self.recv_addLocalFile() + + def send_addLocalFile(self, pid, name, path): + self._oprot.writeMessageBegin('addLocalFile', TMessageType.CALL, self._seqid) + args = addLocalFile_args() + args.pid = pid + args.name = name + args.path = path + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_addLocalFile(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = addLocalFile_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + return + def deleteFiles(self, fids): """ Parameters: @@ -2115,57 +2093,6 @@ class Client(Iface): self._iprot.readMessageEnd() return - def stopDownloads(self, fids): - """ - Parameters: - - fids - """ - self.send_stopDownloads(fids) - self.recv_stopDownloads() - - def send_stopDownloads(self, fids): - self._oprot.writeMessageBegin('stopDownloads', TMessageType.CALL, self._seqid) - args = stopDownloads_args() - args.fids = fids - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_stopDownloads(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = stopDownloads_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - - def stopAllDownloads(self, ): - self.send_stopAllDownloads() - self.recv_stopAllDownloads() - - def send_stopAllDownloads(self, ): - self._oprot.writeMessageBegin('stopAllDownloads', TMessageType.CALL, self._seqid) - args = stopAllDownloads_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_stopAllDownloads(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = stopAllDownloads_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - def restartFailed(self, ): self.send_restartFailed() self.recv_restartFailed() @@ -2449,6 +2376,82 @@ class Client(Iface): self._iprot.readMessageEnd() return + def getProgressInfo(self, ): + self.send_getProgressInfo() + return self.recv_getProgressInfo() + + def send_getProgressInfo(self, ): + self._oprot.writeMessageBegin('getProgressInfo', TMessageType.CALL, self._seqid) + args = getProgressInfo_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getProgressInfo(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getProgressInfo_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getProgressInfo failed: unknown result"); + + def stopDownloads(self, fids): + """ + Parameters: + - fids + """ + self.send_stopDownloads(fids) + self.recv_stopDownloads() + + def send_stopDownloads(self, fids): + self._oprot.writeMessageBegin('stopDownloads', TMessageType.CALL, self._seqid) + args = stopDownloads_args() + args.fids = fids + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_stopDownloads(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = stopDownloads_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + def stopAllDownloads(self, ): + self.send_stopAllDownloads() + self.recv_stopAllDownloads() + + def send_stopAllDownloads(self, ): + self._oprot.writeMessageBegin('stopAllDownloads', TMessageType.CALL, self._seqid) + args = stopAllDownloads_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_stopAllDownloads(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = stopAllDownloads_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + def isInteractionWaiting(self, mode): """ Parameters: @@ -2596,63 +2599,6 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getNotifications failed: unknown result"); - def getAddonHandler(self, ): - self.send_getAddonHandler() - return self.recv_getAddonHandler() - - def send_getAddonHandler(self, ): - self._oprot.writeMessageBegin('getAddonHandler', TMessageType.CALL, self._seqid) - args = getAddonHandler_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getAddonHandler(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getAddonHandler_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getAddonHandler failed: unknown result"); - - def callAddonHandler(self, plugin, func, pid_or_fid): - """ - Parameters: - - plugin - - func - - pid_or_fid - """ - self.send_callAddonHandler(plugin, func, pid_or_fid) - self.recv_callAddonHandler() - - def send_callAddonHandler(self, plugin, func, pid_or_fid): - self._oprot.writeMessageBegin('callAddonHandler', TMessageType.CALL, self._seqid) - args = callAddonHandler_args() - args.plugin = plugin - args.func = func - args.pid_or_fid = pid_or_fid - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_callAddonHandler(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = callAddonHandler_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - def getEvents(self, uuid): """ Parameters: @@ -3006,155 +2952,189 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "setPassword failed: unknown result"); - def getServices(self, ): - self.send_getServices() - return self.recv_getServices() + def getAllInfo(self, ): + self.send_getAllInfo() + return self.recv_getAllInfo() - def send_getServices(self, ): - self._oprot.writeMessageBegin('getServices', TMessageType.CALL, self._seqid) - args = getServices_args() + def send_getAllInfo(self, ): + self._oprot.writeMessageBegin('getAllInfo', TMessageType.CALL, self._seqid) + args = getAllInfo_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getServices(self, ): + def recv_getAllInfo(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getServices_result() + result = getAllInfo_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getServices failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllInfo failed: unknown result"); - def hasService(self, plugin, func): + def getInfoByPlugin(self, plugin): """ Parameters: - plugin - - func """ - self.send_hasService(plugin, func) - return self.recv_hasService() + self.send_getInfoByPlugin(plugin) + return self.recv_getInfoByPlugin() - def send_hasService(self, plugin, func): - self._oprot.writeMessageBegin('hasService', TMessageType.CALL, self._seqid) - args = hasService_args() + def send_getInfoByPlugin(self, plugin): + self._oprot.writeMessageBegin('getInfoByPlugin', TMessageType.CALL, self._seqid) + args = getInfoByPlugin_args() args.plugin = plugin - args.func = func args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_hasService(self, ): + def recv_getInfoByPlugin(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getInfoByPlugin_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getInfoByPlugin failed: unknown result"); + + def getAddonHandler(self, ): + self.send_getAddonHandler() + return self.recv_getAddonHandler() + + def send_getAddonHandler(self, ): + self._oprot.writeMessageBegin('getAddonHandler', TMessageType.CALL, self._seqid) + args = getAddonHandler_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getAddonHandler(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = hasService_result() + result = getAddonHandler_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "hasService failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getAddonHandler failed: unknown result"); - def call(self, plugin, func, arguments): + def hasAddonHandler(self, plugin, func): """ Parameters: - plugin - func - - arguments """ - self.send_call(plugin, func, arguments) - return self.recv_call() + self.send_hasAddonHandler(plugin, func) + return self.recv_hasAddonHandler() - def send_call(self, plugin, func, arguments): - self._oprot.writeMessageBegin('call', TMessageType.CALL, self._seqid) - args = call_args() + def send_hasAddonHandler(self, plugin, func): + self._oprot.writeMessageBegin('hasAddonHandler', TMessageType.CALL, self._seqid) + args = hasAddonHandler_args() args.plugin = plugin args.func = func - args.arguments = arguments args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_call(self, ): + def recv_hasAddonHandler(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = call_result() + result = hasAddonHandler_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - if result.ex is not None: - raise result.ex - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "call failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "hasAddonHandler failed: unknown result"); - def getAllInfo(self, ): - self.send_getAllInfo() - return self.recv_getAllInfo() + def callAddon(self, plugin, func, arguments): + """ + Parameters: + - plugin + - func + - arguments + """ + self.send_callAddon(plugin, func, arguments) + self.recv_callAddon() - def send_getAllInfo(self, ): - self._oprot.writeMessageBegin('getAllInfo', TMessageType.CALL, self._seqid) - args = getAllInfo_args() + def send_callAddon(self, plugin, func, arguments): + self._oprot.writeMessageBegin('callAddon', TMessageType.CALL, self._seqid) + args = callAddon_args() + args.plugin = plugin + args.func = func + args.arguments = arguments args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getAllInfo(self, ): + def recv_callAddon(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getAllInfo_result() + result = callAddon_result() result.read(self._iprot) self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllInfo failed: unknown result"); + if result.e is not None: + raise result.e + if result.ex is not None: + raise result.ex + return - def getInfoByPlugin(self, plugin): + def callAddonHandler(self, plugin, func, pid_or_fid): """ Parameters: - plugin + - func + - pid_or_fid """ - self.send_getInfoByPlugin(plugin) - return self.recv_getInfoByPlugin() + self.send_callAddonHandler(plugin, func, pid_or_fid) + self.recv_callAddonHandler() - def send_getInfoByPlugin(self, plugin): - self._oprot.writeMessageBegin('getInfoByPlugin', TMessageType.CALL, self._seqid) - args = getInfoByPlugin_args() + def send_callAddonHandler(self, plugin, func, pid_or_fid): + self._oprot.writeMessageBegin('callAddonHandler', TMessageType.CALL, self._seqid) + args = callAddonHandler_args() args.plugin = plugin + args.func = func + args.pid_or_fid = pid_or_fid args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getInfoByPlugin(self, ): + def recv_callAddonHandler(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getInfoByPlugin_result() + result = callAddonHandler_result() result.read(self._iprot) self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getInfoByPlugin failed: unknown result"); + if result.e is not None: + raise result.e + if result.ex is not None: + raise result.ex + return class Processor(Iface, TProcessor): @@ -3174,7 +3154,6 @@ class Processor(Iface, TProcessor): self._processMap["isTimeReconnect"] = Processor.process_isTimeReconnect self._processMap["toggleReconnect"] = Processor.process_toggleReconnect self._processMap["scanDownloadFolder"] = Processor.process_scanDownloadFolder - self._processMap["getProgressInfo"] = Processor.process_getProgressInfo self._processMap["getConfigValue"] = Processor.process_getConfigValue self._processMap["setConfigValue"] = Processor.process_setConfigValue self._processMap["getConfig"] = Processor.process_getConfig @@ -3188,13 +3167,13 @@ class Processor(Iface, TProcessor): self._processMap["pollResults"] = Processor.process_pollResults self._processMap["generatePackages"] = Processor.process_generatePackages self._processMap["generateAndAddPackages"] = Processor.process_generateAndAddPackages - self._processMap["autoAddLinks"] = Processor.process_autoAddLinks self._processMap["createPackage"] = Processor.process_createPackage self._processMap["addPackage"] = Processor.process_addPackage self._processMap["addPackageP"] = Processor.process_addPackageP self._processMap["addPackageChild"] = Processor.process_addPackageChild self._processMap["uploadContainer"] = Processor.process_uploadContainer self._processMap["addLinks"] = Processor.process_addLinks + self._processMap["addLocalFile"] = Processor.process_addLocalFile self._processMap["deleteFiles"] = Processor.process_deleteFiles self._processMap["deletePackages"] = Processor.process_deletePackages self._processMap["getCollector"] = Processor.process_getCollector @@ -3214,8 +3193,6 @@ class Processor(Iface, TProcessor): self._processMap["restartPackage"] = Processor.process_restartPackage self._processMap["restartFile"] = Processor.process_restartFile self._processMap["recheckPackage"] = Processor.process_recheckPackage - self._processMap["stopDownloads"] = Processor.process_stopDownloads - self._processMap["stopAllDownloads"] = Processor.process_stopAllDownloads self._processMap["restartFailed"] = Processor.process_restartFailed self._processMap["setFilePaused"] = Processor.process_setFilePaused self._processMap["setPackagePaused"] = Processor.process_setPackagePaused @@ -3225,13 +3202,14 @@ class Processor(Iface, TProcessor): self._processMap["moveFiles"] = Processor.process_moveFiles self._processMap["orderPackage"] = Processor.process_orderPackage self._processMap["orderFiles"] = Processor.process_orderFiles + self._processMap["getProgressInfo"] = Processor.process_getProgressInfo + self._processMap["stopDownloads"] = Processor.process_stopDownloads + self._processMap["stopAllDownloads"] = Processor.process_stopAllDownloads self._processMap["isInteractionWaiting"] = Processor.process_isInteractionWaiting self._processMap["getInteractionTask"] = Processor.process_getInteractionTask self._processMap["setInteractionResult"] = Processor.process_setInteractionResult self._processMap["generateDownloadLink"] = Processor.process_generateDownloadLink self._processMap["getNotifications"] = Processor.process_getNotifications - self._processMap["getAddonHandler"] = Processor.process_getAddonHandler - self._processMap["callAddonHandler"] = Processor.process_callAddonHandler self._processMap["getEvents"] = Processor.process_getEvents self._processMap["getAccounts"] = Processor.process_getAccounts self._processMap["getAccountTypes"] = Processor.process_getAccountTypes @@ -3244,11 +3222,12 @@ class Processor(Iface, TProcessor): self._processMap["updateUserData"] = Processor.process_updateUserData self._processMap["removeUser"] = Processor.process_removeUser self._processMap["setPassword"] = Processor.process_setPassword - self._processMap["getServices"] = Processor.process_getServices - self._processMap["hasService"] = Processor.process_hasService - self._processMap["call"] = Processor.process_call self._processMap["getAllInfo"] = Processor.process_getAllInfo self._processMap["getInfoByPlugin"] = Processor.process_getInfoByPlugin + self._processMap["getAddonHandler"] = Processor.process_getAddonHandler + self._processMap["hasAddonHandler"] = Processor.process_hasAddonHandler + self._processMap["callAddon"] = Processor.process_callAddon + self._processMap["callAddonHandler"] = Processor.process_callAddonHandler def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -3408,17 +3387,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_getProgressInfo(self, seqid, iprot, oprot): - args = getProgressInfo_args() - args.read(iprot) - iprot.readMessageEnd() - result = getProgressInfo_result() - result.success = self._handler.getProgressInfo() - oprot.writeMessageBegin("getProgressInfo", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_getConfigValue(self, seqid, iprot, oprot): args = getConfigValue_args() args.read(iprot) @@ -3562,17 +3530,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_autoAddLinks(self, seqid, iprot, oprot): - args = autoAddLinks_args() - args.read(iprot) - iprot.readMessageEnd() - result = autoAddLinks_result() - result.success = self._handler.autoAddLinks(args.links) - oprot.writeMessageBegin("autoAddLinks", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_createPackage(self, seqid, iprot, oprot): args = createPackage_args() args.read(iprot) @@ -3642,6 +3599,20 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_addLocalFile(self, seqid, iprot, oprot): + args = addLocalFile_args() + args.read(iprot) + iprot.readMessageEnd() + result = addLocalFile_result() + try: + self._handler.addLocalFile(args.pid, args.name, args.path) + except PackageDoesNotExists, e: + result.e = e + oprot.writeMessageBegin("addLocalFile", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_deleteFiles(self, seqid, iprot, oprot): args = deleteFiles_args() args.read(iprot) @@ -3857,28 +3828,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_stopDownloads(self, seqid, iprot, oprot): - args = stopDownloads_args() - args.read(iprot) - iprot.readMessageEnd() - result = stopDownloads_result() - self._handler.stopDownloads(args.fids) - oprot.writeMessageBegin("stopDownloads", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_stopAllDownloads(self, seqid, iprot, oprot): - args = stopAllDownloads_args() - args.read(iprot) - iprot.readMessageEnd() - result = stopAllDownloads_result() - self._handler.stopAllDownloads() - oprot.writeMessageBegin("stopAllDownloads", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_restartFailed(self, seqid, iprot, oprot): args = restartFailed_args() args.read(iprot) @@ -3996,6 +3945,39 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_getProgressInfo(self, seqid, iprot, oprot): + args = getProgressInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = getProgressInfo_result() + result.success = self._handler.getProgressInfo() + oprot.writeMessageBegin("getProgressInfo", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_stopDownloads(self, seqid, iprot, oprot): + args = stopDownloads_args() + args.read(iprot) + iprot.readMessageEnd() + result = stopDownloads_result() + self._handler.stopDownloads(args.fids) + oprot.writeMessageBegin("stopDownloads", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_stopAllDownloads(self, seqid, iprot, oprot): + args = stopAllDownloads_args() + args.read(iprot) + iprot.readMessageEnd() + result = stopAllDownloads_result() + self._handler.stopAllDownloads() + oprot.writeMessageBegin("stopAllDownloads", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_isInteractionWaiting(self, seqid, iprot, oprot): args = isInteractionWaiting_args() args.read(iprot) @@ -4051,28 +4033,6 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_getAddonHandler(self, seqid, iprot, oprot): - args = getAddonHandler_args() - args.read(iprot) - iprot.readMessageEnd() - result = getAddonHandler_result() - result.success = self._handler.getAddonHandler() - oprot.writeMessageBegin("getAddonHandler", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_callAddonHandler(self, seqid, iprot, oprot): - args = callAddonHandler_args() - args.read(iprot) - iprot.readMessageEnd() - result = callAddonHandler_result() - self._handler.callAddonHandler(args.plugin, args.func, args.pid_or_fid) - oprot.writeMessageBegin("callAddonHandler", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - def process_getEvents(self, seqid, iprot, oprot): args = getEvents_args() args.read(iprot) @@ -4205,62 +4165,78 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_getServices(self, seqid, iprot, oprot): - args = getServices_args() + def process_getAllInfo(self, seqid, iprot, oprot): + args = getAllInfo_args() args.read(iprot) iprot.readMessageEnd() - result = getServices_result() - result.success = self._handler.getServices() - oprot.writeMessageBegin("getServices", TMessageType.REPLY, seqid) + result = getAllInfo_result() + result.success = self._handler.getAllInfo() + oprot.writeMessageBegin("getAllInfo", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_hasService(self, seqid, iprot, oprot): - args = hasService_args() + def process_getInfoByPlugin(self, seqid, iprot, oprot): + args = getInfoByPlugin_args() args.read(iprot) iprot.readMessageEnd() - result = hasService_result() - result.success = self._handler.hasService(args.plugin, args.func) - oprot.writeMessageBegin("hasService", TMessageType.REPLY, seqid) + result = getInfoByPlugin_result() + result.success = self._handler.getInfoByPlugin(args.plugin) + oprot.writeMessageBegin("getInfoByPlugin", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_call(self, seqid, iprot, oprot): - args = call_args() + def process_getAddonHandler(self, seqid, iprot, oprot): + args = getAddonHandler_args() args.read(iprot) iprot.readMessageEnd() - result = call_result() - try: - result.success = self._handler.call(args.plugin, args.func, args.arguments) - except ServiceDoesNotExists, ex: - result.ex = ex - except ServiceException, e: - result.e = e - oprot.writeMessageBegin("call", TMessageType.REPLY, seqid) + result = getAddonHandler_result() + result.success = self._handler.getAddonHandler() + oprot.writeMessageBegin("getAddonHandler", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getAllInfo(self, seqid, iprot, oprot): - args = getAllInfo_args() + def process_hasAddonHandler(self, seqid, iprot, oprot): + args = hasAddonHandler_args() args.read(iprot) iprot.readMessageEnd() - result = getAllInfo_result() - result.success = self._handler.getAllInfo() - oprot.writeMessageBegin("getAllInfo", TMessageType.REPLY, seqid) + result = hasAddonHandler_result() + result.success = self._handler.hasAddonHandler(args.plugin, args.func) + oprot.writeMessageBegin("hasAddonHandler", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getInfoByPlugin(self, seqid, iprot, oprot): - args = getInfoByPlugin_args() + def process_callAddon(self, seqid, iprot, oprot): + args = callAddon_args() args.read(iprot) iprot.readMessageEnd() - result = getInfoByPlugin_result() - result.success = self._handler.getInfoByPlugin(args.plugin) - oprot.writeMessageBegin("getInfoByPlugin", TMessageType.REPLY, seqid) + result = callAddon_result() + try: + self._handler.callAddon(args.plugin, args.func, args.arguments) + except ServiceDoesNotExists, e: + result.e = e + except ServiceException, ex: + result.ex = ex + oprot.writeMessageBegin("callAddon", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_callAddonHandler(self, seqid, iprot, oprot): + args = callAddonHandler_args() + args.read(iprot) + iprot.readMessageEnd() + result = callAddonHandler_result() + try: + self._handler.callAddonHandler(args.plugin, args.func, args.pid_or_fid) + except ServiceDoesNotExists, e: + result.e = e + except ServiceException, ex: + result.ex = ex + oprot.writeMessageBegin("callAddonHandler", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -4584,33 +4560,6 @@ class scanDownloadFolder_result(TBase): ) -class getProgressInfo_args(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - -class getProgressInfo_result(TBase): - """ - Attributes: - - success - """ - - __slots__ = [ - 'success', - ] - - thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(ProgressInfo, ProgressInfo.thrift_spec)), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - class getConfigValue_args(TBase): """ Attributes: @@ -5090,43 +5039,6 @@ class generateAndAddPackages_result(TBase): self.success = success -class autoAddLinks_args(TBase): - """ - Attributes: - - links - """ - - __slots__ = [ - 'links', - ] - - thrift_spec = ( - None, # 0 - (1, TType.LIST, 'links', (TType.STRING,None), None, ), # 1 - ) - - def __init__(self, links=None,): - self.links = links - - -class autoAddLinks_result(TBase): - """ - Attributes: - - success - """ - - __slots__ = [ - 'success', - ] - - thrift_spec = ( - (0, TType.LIST, 'success', (TType.I32,None), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - class createPackage_args(TBase): """ Attributes: @@ -5418,6 +5330,52 @@ class addLinks_result(TBase): self.e = e +class addLocalFile_args(TBase): + """ + Attributes: + - pid + - name + - path + """ + + __slots__ = [ + 'pid', + 'name', + 'path', + ] + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'pid', None, None, ), # 1 + (2, TType.STRING, 'name', None, None, ), # 2 + (3, TType.STRING, 'path', None, None, ), # 3 + ) + + def __init__(self, pid=None, name=None, path=None,): + self.pid = pid + self.name = name + self.path = path + + +class addLocalFile_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 deleteFiles_args(TBase): """ Attributes: @@ -6034,52 +5992,6 @@ class recheckPackage_result(TBase): ) -class stopDownloads_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 stopDownloads_result(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - -class stopAllDownloads_args(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - -class stopAllDownloads_result(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - class restartFailed_args(TBase): __slots__ = [ @@ -6427,6 +6339,79 @@ class orderFiles_result(TBase): ) +class getProgressInfo_args(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class getProgressInfo_result(TBase): + """ + Attributes: + - success + """ + + __slots__ = [ + 'success', + ] + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(ProgressInfo, ProgressInfo.thrift_spec)), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + +class stopDownloads_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 stopDownloads_result(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class stopAllDownloads_args(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class stopAllDownloads_result(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + class isInteractionWaiting_args(TBase): """ Attributes: @@ -6601,69 +6586,6 @@ class getNotifications_result(TBase): self.success = success -class getAddonHandler_args(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - -class getAddonHandler_result(TBase): - """ - Attributes: - - success - """ - - __slots__ = [ - 'success', - ] - - thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(AddonService, AddonService.thrift_spec))), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - -class callAddonHandler_args(TBase): - """ - Attributes: - - plugin - - func - - pid_or_fid - """ - - __slots__ = [ - 'plugin', - 'func', - 'pid_or_fid', - ] - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'func', None, None, ), # 2 - (3, TType.I32, 'pid_or_fid', None, None, ), # 3 - ) - - def __init__(self, plugin=None, func=None, pid_or_fid=None,): - self.plugin = plugin - self.func = func - self.pid_or_fid = pid_or_fid - - -class callAddonHandler_result(TBase): - - __slots__ = [ - ] - - thrift_spec = ( - ) - - class getEvents_args(TBase): """ Attributes: @@ -7074,7 +6996,7 @@ class setPassword_result(TBase): self.success = success -class getServices_args(TBase): +class getAllInfo_args(TBase): __slots__ = [ ] @@ -7083,7 +7005,7 @@ class getServices_args(TBase): ) -class getServices_result(TBase): +class getAllInfo_result(TBase): """ Attributes: - success @@ -7094,37 +7016,33 @@ class getServices_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(AddonService, AddonService.thrift_spec))), None, ), # 0 + (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(AddonInfo, AddonInfo.thrift_spec))), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class hasService_args(TBase): +class getInfoByPlugin_args(TBase): """ Attributes: - plugin - - func """ __slots__ = [ 'plugin', - 'func', ] thrift_spec = ( None, # 0 (1, TType.STRING, 'plugin', None, None, ), # 1 - (2, TType.STRING, 'func', None, None, ), # 2 ) - def __init__(self, plugin=None, func=None,): + def __init__(self, plugin=None,): self.plugin = plugin - self.func = func -class hasService_result(TBase): +class getInfoByPlugin_result(TBase): """ Attributes: - success @@ -7135,126 +7053,177 @@ class hasService_result(TBase): ] thrift_spec = ( - (0, TType.BOOL, 'success', None, None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT,(AddonInfo, AddonInfo.thrift_spec)), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class call_args(TBase): +class getAddonHandler_args(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class getAddonHandler_result(TBase): + """ + Attributes: + - success + """ + + __slots__ = [ + 'success', + ] + + thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(AddonService, AddonService.thrift_spec))), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + +class hasAddonHandler_args(TBase): """ Attributes: - plugin - func - - arguments """ __slots__ = [ 'plugin', 'func', - 'arguments', ] thrift_spec = ( None, # 0 (1, TType.STRING, 'plugin', None, None, ), # 1 (2, TType.STRING, 'func', None, None, ), # 2 - (3, TType.STRING, 'arguments', None, None, ), # 3 ) - def __init__(self, plugin=None, func=None, arguments=None,): + def __init__(self, plugin=None, func=None,): self.plugin = plugin self.func = func - self.arguments = arguments -class call_result(TBase): +class hasAddonHandler_result(TBase): """ Attributes: - success - - ex - - e """ __slots__ = [ 'success', - 'ex', - 'e', ] thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'ex', (ServiceDoesNotExists, ServiceDoesNotExists.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'e', (ServiceException, ServiceException.thrift_spec), None, ), # 2 + (0, TType.BOOL, 'success', None, None, ), # 0 ) - def __init__(self, success=None, ex=None, e=None,): + def __init__(self, success=None,): self.success = success - self.ex = ex - self.e = e -class getAllInfo_args(TBase): +class callAddon_args(TBase): + """ + Attributes: + - plugin + - func + - arguments + """ __slots__ = [ + 'plugin', + 'func', + 'arguments', ] thrift_spec = ( + None, # 0 + (1, TType.STRING, 'plugin', None, None, ), # 1 + (2, TType.STRING, 'func', None, None, ), # 2 + (3, TType.LIST, 'arguments', (TType.STRING,None), None, ), # 3 ) + def __init__(self, plugin=None, func=None, arguments=None,): + self.plugin = plugin + self.func = func + self.arguments = arguments + -class getAllInfo_result(TBase): +class callAddon_result(TBase): """ Attributes: - - success + - e + - ex """ __slots__ = [ - 'success', + 'e', + 'ex', ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(AddonInfo, AddonInfo.thrift_spec))), None, ), # 0 + None, # 0 + (1, TType.STRUCT, 'e', (ServiceDoesNotExists, ServiceDoesNotExists.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ex', (ServiceException, ServiceException.thrift_spec), None, ), # 2 ) - def __init__(self, success=None,): - self.success = success + def __init__(self, e=None, ex=None,): + self.e = e + self.ex = ex -class getInfoByPlugin_args(TBase): +class callAddonHandler_args(TBase): """ Attributes: - plugin + - func + - pid_or_fid """ __slots__ = [ 'plugin', + 'func', + 'pid_or_fid', ] thrift_spec = ( None, # 0 (1, TType.STRING, 'plugin', None, None, ), # 1 + (2, TType.STRING, 'func', None, None, ), # 2 + (3, TType.I32, 'pid_or_fid', None, None, ), # 3 ) - def __init__(self, plugin=None,): + def __init__(self, plugin=None, func=None, pid_or_fid=None,): self.plugin = plugin + self.func = func + self.pid_or_fid = pid_or_fid -class getInfoByPlugin_result(TBase): +class callAddonHandler_result(TBase): """ Attributes: - - success + - e + - ex """ __slots__ = [ - 'success', + 'e', + 'ex', ] thrift_spec = ( - (0, TType.LIST, 'success', (TType.STRUCT,(AddonInfo, AddonInfo.thrift_spec)), None, ), # 0 + None, # 0 + (1, TType.STRUCT, 'e', (ServiceDoesNotExists, ServiceDoesNotExists.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ex', (ServiceException, ServiceException.thrift_spec), None, ), # 2 ) - def __init__(self, success=None,): - self.success = success + def __init__(self, e=None, ex=None,): + self.e = e + self.ex = ex diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index d170f4688..3e4cce276 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -195,38 +195,35 @@ class Permission(TBase): All = 0 Add = 1 Delete = 2 - Status = 4 - List = 16 - Modify = 32 - Download = 64 - Accounts = 128 - Interaction = 256 - Addons = 512 + Modify = 4 + Status = 8 + Download = 16 + Accounts = 32 + Interaction = 64 + Addons = 128 _VALUES_TO_NAMES = { 0: "All", 1: "Add", 2: "Delete", - 4: "Status", - 16: "List", - 32: "Modify", - 64: "Download", - 128: "Accounts", - 256: "Interaction", - 512: "Addons", + 4: "Modify", + 8: "Status", + 16: "Download", + 32: "Accounts", + 64: "Interaction", + 128: "Addons", } _NAMES_TO_VALUES = { "All": 0, "Add": 1, "Delete": 2, - "Status": 4, - "List": 16, - "Modify": 32, - "Download": 64, - "Accounts": 128, - "Interaction": 256, - "Addons": 512, + "Modify": 4, + "Status": 8, + "Download": 16, + "Accounts": 32, + "Interaction": 64, + "Addons": 128, } class Role(TBase): @@ -675,6 +672,37 @@ class InteractionTask(TBase): self.plugin = plugin +class AddonService(TBase): + """ + Attributes: + - func_name + - description + - arguments + - media + """ + + __slots__ = [ + 'func_name', + 'description', + 'arguments', + 'media', + ] + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'func_name', None, None, ), # 1 + (2, TType.STRING, 'description', None, None, ), # 2 + (3, TType.LIST, 'arguments', (TType.STRING,None), None, ), # 3 + (4, TType.I16, 'media', None, None, ), # 4 + ) + + def __init__(self, func_name=None, description=None, arguments=None, media=None,): + self.func_name = func_name + self.description = description + self.arguments = arguments + self.media = media + + class AddonInfo(TBase): """ Attributes: @@ -818,6 +846,8 @@ class UserData(TBase): - folder - traffic - dllimit + - dlquota + - hddquota - user - templateName """ @@ -831,6 +861,8 @@ class UserData(TBase): 'folder', 'traffic', 'dllimit', + 'dlquota', + 'hddquota', 'user', 'templateName', ] @@ -845,11 +877,13 @@ class UserData(TBase): (6, TType.STRING, 'folder', None, None, ), # 6 (7, TType.I64, 'traffic', None, None, ), # 7 (8, TType.I16, 'dllimit', None, None, ), # 8 - (9, TType.I32, 'user', None, None, ), # 9 - (10, TType.STRING, 'templateName', None, None, ), # 10 + (9, TType.STRING, 'dlquota', None, None, ), # 9 + (10, TType.I64, 'hddquota', None, None, ), # 10 + (11, TType.I32, 'user', None, None, ), # 11 + (12, TType.STRING, 'templateName', None, None, ), # 12 ) - def __init__(self, uid=None, name=None, email=None, role=None, permission=None, folder=None, traffic=None, dllimit=None, user=None, templateName=None,): + def __init__(self, uid=None, name=None, email=None, role=None, permission=None, folder=None, traffic=None, dllimit=None, dlquota=None, hddquota=None, user=None, templateName=None,): self.uid = uid self.name = name self.email = email @@ -858,6 +892,8 @@ class UserData(TBase): self.folder = folder self.traffic = traffic self.dllimit = dllimit + self.dlquota = dlquota + self.hddquota = hddquota self.user = user self.templateName = templateName @@ -921,37 +957,6 @@ class AccountInfo(TBase): self.options = options -class AddonService(TBase): - """ - Attributes: - - func_name - - description - - media - - package - """ - - __slots__ = [ - 'func_name', - 'description', - 'media', - 'package', - ] - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'func_name', None, None, ), # 1 - (2, TType.STRING, 'description', None, None, ), # 2 - (3, TType.I16, 'media', None, None, ), # 3 - (4, TType.BOOL, 'package', None, None, ), # 4 - ) - - def __init__(self, func_name=None, description=None, media=None, package=None,): - self.func_name = func_name - self.description = description - self.media = media - self.package = package - - class OnlineCheck(TBase): """ Attributes: |