diff options
Diffstat (limited to 'module/remote/thriftbackend')
-rw-r--r-- | module/remote/thriftbackend/pyload.thrift | 45 | ||||
-rwxr-xr-x | module/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 69 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/Pyload.py | 465 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/ttypes.py | 63 |
4 files changed, 374 insertions, 268 deletions
diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index 23b39fada..fb906e23a 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -90,7 +90,7 @@ enum Permission { Download = 8, // can download from webinterface Accounts = 16, // can access accounts Interaction = 32, // can interact with plugins - Addons = 64 // user can activate addons + Plugins = 64 // user can configure plugins and activate addons } enum Role { @@ -98,6 +98,8 @@ enum Role { User = 1 } +// TODO: progress vs Download progress ?! + struct ProgressInfo { 1: FileID fid, 2: string name, @@ -217,23 +219,31 @@ struct AddonInfo { struct ConfigItem { 1: string name, - 2: string display_name, + 2: string label, 3: string description, 4: string type, 5: JSONString default_value, 6: JSONString value, } -struct ConfigSection { +struct ConfigHolder { 1: string name, - 2: string display_name, + 2: string label, 3: string description, 4: string long_description, - 5: optional list<ConfigItem> items, + 5: list<ConfigItem> items, 6: optional list<AddonInfo> info, 7: optional list<InteractionTask> handler, // if null plugin is not loaded } +struct ConfigInfo { + 1: string name, + 2: string label, + 3: string description, + 4: bool saved, + 5: bool activated, +} + struct EventInfo { 1: string eventname, 2: list<JSONString> event_args, @@ -250,7 +260,7 @@ struct UserData { 8: i16 dllimit 9: string dlquota, 10: ByteCount hddquota, - 11: UserID user + 11: UserID user, 12: string templateName } @@ -314,17 +324,21 @@ service Pyload { bool isTimeDownload(), bool isTimeReconnect(), bool toggleReconnect(), - void scanDownloadFolder(), + + // TODO + //void scanDownloadFolder(), /////////////////////// // Configuration /////////////////////// - string getConfigValue(1: string section, 2: string option), - void setConfigValue(1: string section, 2: string option, 3: string value), - map<string, ConfigSection> getConfig(), - map<PluginName, ConfigSection> getPluginConfig(), - ConfigSection configureSection(1: string section), + map<string, ConfigHolder> getConfig(), + list<ConfigInfo> getGlobalPlugins(), + list<ConfigInfo> getUserPlugins(), + + ConfigHolder configurePlugin(1: PluginName plugin), + void saveConfig(1: ConfigHolder config), + void deleteConfig(1: ConfigHolder config), void setConfigHandler(1: PluginName plugin, 2: InteractionID iid, 3: JSONString value), /////////////////////// @@ -373,6 +387,8 @@ service Pyload { // Collector /////////////////////// + // TODO: reasonable link collector concept + list<LinkStatus> getCollector(), void addToCollector(1: LinkList links), @@ -462,8 +478,9 @@ service Pyload { /////////////////////// list<AccountInfo> getAccounts(1: bool refresh), - list<string> getAccountTypes() - void updateAccount(1: PluginName plugin, 2: string account, 3: string password, 4: map<string, string> options), + list<string> getAccountTypes(), + void updateAccount(1: PluginName plugin, 2: string account, 3: string password), + void updateAccountInfo(1: AccountInfo account), void removeAccount(1: PluginName plugin, 2: string account), ///////////////////////// diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index a84de7978..78d251501 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -35,12 +35,12 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' bool isTimeDownload()' print ' bool isTimeReconnect()' print ' bool toggleReconnect()' - print ' void scanDownloadFolder()' - print ' string getConfigValue(string section, string option)' - print ' void setConfigValue(string section, string option, string value)' print ' getConfig()' - print ' getPluginConfig()' - print ' ConfigSection configureSection(string section)' + print ' getGlobalPlugins()' + print ' getUserPlugins()' + print ' ConfigHolder configurePlugin(PluginName plugin)' + print ' void saveConfig(ConfigHolder config)' + print ' void deleteConfig(ConfigHolder config)' print ' void setConfigHandler(PluginName plugin, InteractionID iid, JSONString value)' print ' checkURLs(LinkList urls)' print ' parseURLs(string html, string url)' @@ -95,7 +95,8 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' getEvents(string uuid)' print ' getAccounts(bool refresh)' print ' getAccountTypes()' - print ' void updateAccount(PluginName plugin, string account, string password, options)' + print ' void updateAccount(PluginName plugin, string account, string password)' + print ' void updateAccountInfo(AccountInfo account)' print ' void removeAccount(PluginName plugin, string account)' print ' bool login(string username, string password)' print ' UserData getUserData()' @@ -233,41 +234,41 @@ elif cmd == 'toggleReconnect': sys.exit(1) pp.pprint(client.toggleReconnect()) -elif cmd == 'scanDownloadFolder': +elif cmd == 'getConfig': if len(args) != 0: - print 'scanDownloadFolder requires 0 args' + print 'getConfig requires 0 args' sys.exit(1) - pp.pprint(client.scanDownloadFolder()) + pp.pprint(client.getConfig()) -elif cmd == 'getConfigValue': - if len(args) != 2: - print 'getConfigValue requires 2 args' +elif cmd == 'getGlobalPlugins': + if len(args) != 0: + print 'getGlobalPlugins requires 0 args' sys.exit(1) - pp.pprint(client.getConfigValue(args[0],args[1],)) + pp.pprint(client.getGlobalPlugins()) -elif cmd == 'setConfigValue': - if len(args) != 3: - print 'setConfigValue requires 3 args' +elif cmd == 'getUserPlugins': + if len(args) != 0: + print 'getUserPlugins requires 0 args' sys.exit(1) - pp.pprint(client.setConfigValue(args[0],args[1],args[2],)) + pp.pprint(client.getUserPlugins()) -elif cmd == 'getConfig': - if len(args) != 0: - print 'getConfig requires 0 args' +elif cmd == 'configurePlugin': + if len(args) != 1: + print 'configurePlugin requires 1 args' sys.exit(1) - pp.pprint(client.getConfig()) + pp.pprint(client.configurePlugin(eval(args[0]),)) -elif cmd == 'getPluginConfig': - if len(args) != 0: - print 'getPluginConfig requires 0 args' +elif cmd == 'saveConfig': + if len(args) != 1: + print 'saveConfig requires 1 args' sys.exit(1) - pp.pprint(client.getPluginConfig()) + pp.pprint(client.saveConfig(eval(args[0]),)) -elif cmd == 'configureSection': +elif cmd == 'deleteConfig': if len(args) != 1: - print 'configureSection requires 1 args' + print 'deleteConfig requires 1 args' sys.exit(1) - pp.pprint(client.configureSection(args[0],)) + pp.pprint(client.deleteConfig(eval(args[0]),)) elif cmd == 'setConfigHandler': if len(args) != 3: @@ -594,10 +595,16 @@ elif cmd == 'getAccountTypes': pp.pprint(client.getAccountTypes()) elif cmd == 'updateAccount': - if len(args) != 4: - print 'updateAccount requires 4 args' + if len(args) != 3: + print 'updateAccount requires 3 args' + sys.exit(1) + pp.pprint(client.updateAccount(eval(args[0]),args[1],args[2],)) + +elif cmd == 'updateAccountInfo': + if len(args) != 1: + print 'updateAccountInfo requires 1 args' sys.exit(1) - pp.pprint(client.updateAccount(eval(args[0]),args[1],args[2],eval(args[3]),)) + pp.pprint(client.updateAccountInfo(eval(args[0]),)) elif cmd == 'removeAccount': if len(args) != 2: diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index c807d3d9e..4134a4d3e 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -53,36 +53,33 @@ class Iface(object): def toggleReconnect(self, ): pass - def scanDownloadFolder(self, ): + def getConfig(self, ): + pass + + def getGlobalPlugins(self, ): pass - def getConfigValue(self, section, option): + def getUserPlugins(self, ): + pass + + def configurePlugin(self, plugin): """ Parameters: - - section - - option + - plugin """ pass - def setConfigValue(self, section, option, value): + def saveConfig(self, config): """ Parameters: - - section - - option - - value + - config """ pass - def getConfig(self, ): - pass - - def getPluginConfig(self, ): - pass - - def configureSection(self, section): + def deleteConfig(self, config): """ Parameters: - - section + - config """ pass @@ -472,13 +469,19 @@ class Iface(object): def getAccountTypes(self, ): pass - def updateAccount(self, plugin, account, password, options): + def updateAccount(self, plugin, account, password): """ Parameters: - plugin - account - password - - options + """ + pass + + def updateAccountInfo(self, account): + """ + Parameters: + - account """ pass @@ -879,172 +882,166 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "toggleReconnect failed: unknown result"); - def scanDownloadFolder(self, ): - self.send_scanDownloadFolder() - self.recv_scanDownloadFolder() + def getConfig(self, ): + self.send_getConfig() + return self.recv_getConfig() - def send_scanDownloadFolder(self, ): - self._oprot.writeMessageBegin('scanDownloadFolder', TMessageType.CALL, self._seqid) - args = scanDownloadFolder_args() + def send_getConfig(self, ): + self._oprot.writeMessageBegin('getConfig', TMessageType.CALL, self._seqid) + args = getConfig_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scanDownloadFolder(self, ): + def recv_getConfig(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = scanDownloadFolder_result() + result = getConfig_result() result.read(self._iprot) self._iprot.readMessageEnd() - return + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getConfig failed: unknown result"); - def getConfigValue(self, section, option): - """ - Parameters: - - section - - option - """ - self.send_getConfigValue(section, option) - return self.recv_getConfigValue() + def getGlobalPlugins(self, ): + self.send_getGlobalPlugins() + return self.recv_getGlobalPlugins() - def send_getConfigValue(self, section, option): - self._oprot.writeMessageBegin('getConfigValue', TMessageType.CALL, self._seqid) - args = getConfigValue_args() - args.section = section - args.option = option + def send_getGlobalPlugins(self, ): + self._oprot.writeMessageBegin('getGlobalPlugins', TMessageType.CALL, self._seqid) + args = getGlobalPlugins_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getConfigValue(self, ): + def recv_getGlobalPlugins(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getConfigValue_result() + result = getGlobalPlugins_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getConfigValue failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getGlobalPlugins failed: unknown result"); - def setConfigValue(self, section, option, value): - """ - Parameters: - - section - - option - - value - """ - self.send_setConfigValue(section, option, value) - self.recv_setConfigValue() + def getUserPlugins(self, ): + self.send_getUserPlugins() + return self.recv_getUserPlugins() - def send_setConfigValue(self, section, option, value): - self._oprot.writeMessageBegin('setConfigValue', TMessageType.CALL, self._seqid) - args = setConfigValue_args() - args.section = section - args.option = option - args.value = value + def send_getUserPlugins(self, ): + self._oprot.writeMessageBegin('getUserPlugins', TMessageType.CALL, self._seqid) + args = getUserPlugins_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_setConfigValue(self, ): + def recv_getUserPlugins(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = setConfigValue_result() + result = getUserPlugins_result() result.read(self._iprot) self._iprot.readMessageEnd() - return + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserPlugins failed: unknown result"); - def getConfig(self, ): - self.send_getConfig() - return self.recv_getConfig() + def configurePlugin(self, plugin): + """ + Parameters: + - plugin + """ + self.send_configurePlugin(plugin) + return self.recv_configurePlugin() - def send_getConfig(self, ): - self._oprot.writeMessageBegin('getConfig', TMessageType.CALL, self._seqid) - args = getConfig_args() + def send_configurePlugin(self, plugin): + self._oprot.writeMessageBegin('configurePlugin', TMessageType.CALL, self._seqid) + args = configurePlugin_args() + args.plugin = plugin args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getConfig(self, ): + def recv_configurePlugin(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getConfig_result() + result = configurePlugin_result() result.read(self._iprot) self._iprot.readMessageEnd() if result.success is not None: return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getConfig failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "configurePlugin failed: unknown result"); - def getPluginConfig(self, ): - self.send_getPluginConfig() - return self.recv_getPluginConfig() + def saveConfig(self, config): + """ + Parameters: + - config + """ + self.send_saveConfig(config) + self.recv_saveConfig() - def send_getPluginConfig(self, ): - self._oprot.writeMessageBegin('getPluginConfig', TMessageType.CALL, self._seqid) - args = getPluginConfig_args() + def send_saveConfig(self, config): + self._oprot.writeMessageBegin('saveConfig', TMessageType.CALL, self._seqid) + args = saveConfig_args() + args.config = config args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getPluginConfig(self, ): + def recv_saveConfig(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = getPluginConfig_result() + result = saveConfig_result() result.read(self._iprot) self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getPluginConfig failed: unknown result"); + return - def configureSection(self, section): + def deleteConfig(self, config): """ Parameters: - - section + - config """ - self.send_configureSection(section) - return self.recv_configureSection() + self.send_deleteConfig(config) + self.recv_deleteConfig() - def send_configureSection(self, section): - self._oprot.writeMessageBegin('configureSection', TMessageType.CALL, self._seqid) - args = configureSection_args() - args.section = section + def send_deleteConfig(self, config): + self._oprot.writeMessageBegin('deleteConfig', TMessageType.CALL, self._seqid) + args = deleteConfig_args() + args.config = config args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_configureSection(self, ): + def recv_deleteConfig(self, ): (fname, mtype, rseqid) = self._iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(self._iprot) self._iprot.readMessageEnd() raise x - result = configureSection_result() + result = deleteConfig_result() result.read(self._iprot) self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "configureSection failed: unknown result"); + return def setConfigHandler(self, plugin, iid, value): """ @@ -2684,24 +2681,22 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "getAccountTypes failed: unknown result"); - def updateAccount(self, plugin, account, password, options): + def updateAccount(self, plugin, account, password): """ Parameters: - plugin - account - password - - options """ - self.send_updateAccount(plugin, account, password, options) + self.send_updateAccount(plugin, account, password) self.recv_updateAccount() - def send_updateAccount(self, plugin, account, password, options): + def send_updateAccount(self, plugin, account, password): self._oprot.writeMessageBegin('updateAccount', TMessageType.CALL, self._seqid) args = updateAccount_args() args.plugin = plugin args.account = account args.password = password - args.options = options args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -2718,6 +2713,34 @@ class Client(Iface): self._iprot.readMessageEnd() return + def updateAccountInfo(self, account): + """ + Parameters: + - account + """ + self.send_updateAccountInfo(account) + self.recv_updateAccountInfo() + + def send_updateAccountInfo(self, account): + self._oprot.writeMessageBegin('updateAccountInfo', TMessageType.CALL, self._seqid) + args = updateAccountInfo_args() + args.account = account + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_updateAccountInfo(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = updateAccountInfo_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + def removeAccount(self, plugin, account): """ Parameters: @@ -3153,12 +3176,12 @@ class Processor(Iface, TProcessor): self._processMap["isTimeDownload"] = Processor.process_isTimeDownload self._processMap["isTimeReconnect"] = Processor.process_isTimeReconnect self._processMap["toggleReconnect"] = Processor.process_toggleReconnect - self._processMap["scanDownloadFolder"] = Processor.process_scanDownloadFolder - self._processMap["getConfigValue"] = Processor.process_getConfigValue - self._processMap["setConfigValue"] = Processor.process_setConfigValue self._processMap["getConfig"] = Processor.process_getConfig - self._processMap["getPluginConfig"] = Processor.process_getPluginConfig - self._processMap["configureSection"] = Processor.process_configureSection + self._processMap["getGlobalPlugins"] = Processor.process_getGlobalPlugins + self._processMap["getUserPlugins"] = Processor.process_getUserPlugins + self._processMap["configurePlugin"] = Processor.process_configurePlugin + self._processMap["saveConfig"] = Processor.process_saveConfig + self._processMap["deleteConfig"] = Processor.process_deleteConfig self._processMap["setConfigHandler"] = Processor.process_setConfigHandler self._processMap["checkURLs"] = Processor.process_checkURLs self._processMap["parseURLs"] = Processor.process_parseURLs @@ -3214,6 +3237,7 @@ class Processor(Iface, TProcessor): self._processMap["getAccounts"] = Processor.process_getAccounts self._processMap["getAccountTypes"] = Processor.process_getAccountTypes self._processMap["updateAccount"] = Processor.process_updateAccount + self._processMap["updateAccountInfo"] = Processor.process_updateAccountInfo self._processMap["removeAccount"] = Processor.process_removeAccount self._processMap["login"] = Processor.process_login self._processMap["getUserData"] = Processor.process_getUserData @@ -3376,68 +3400,68 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() - def process_scanDownloadFolder(self, seqid, iprot, oprot): - args = scanDownloadFolder_args() + def process_getConfig(self, seqid, iprot, oprot): + args = getConfig_args() args.read(iprot) iprot.readMessageEnd() - result = scanDownloadFolder_result() - self._handler.scanDownloadFolder() - oprot.writeMessageBegin("scanDownloadFolder", TMessageType.REPLY, seqid) + result = getConfig_result() + result.success = self._handler.getConfig() + oprot.writeMessageBegin("getConfig", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getConfigValue(self, seqid, iprot, oprot): - args = getConfigValue_args() + def process_getGlobalPlugins(self, seqid, iprot, oprot): + args = getGlobalPlugins_args() args.read(iprot) iprot.readMessageEnd() - result = getConfigValue_result() - result.success = self._handler.getConfigValue(args.section, args.option) - oprot.writeMessageBegin("getConfigValue", TMessageType.REPLY, seqid) + result = getGlobalPlugins_result() + result.success = self._handler.getGlobalPlugins() + oprot.writeMessageBegin("getGlobalPlugins", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_setConfigValue(self, seqid, iprot, oprot): - args = setConfigValue_args() + def process_getUserPlugins(self, seqid, iprot, oprot): + args = getUserPlugins_args() args.read(iprot) iprot.readMessageEnd() - result = setConfigValue_result() - self._handler.setConfigValue(args.section, args.option, args.value) - oprot.writeMessageBegin("setConfigValue", TMessageType.REPLY, seqid) + result = getUserPlugins_result() + result.success = self._handler.getUserPlugins() + oprot.writeMessageBegin("getUserPlugins", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getConfig(self, seqid, iprot, oprot): - args = getConfig_args() + def process_configurePlugin(self, seqid, iprot, oprot): + args = configurePlugin_args() args.read(iprot) iprot.readMessageEnd() - result = getConfig_result() - result.success = self._handler.getConfig() - oprot.writeMessageBegin("getConfig", TMessageType.REPLY, seqid) + result = configurePlugin_result() + result.success = self._handler.configurePlugin(args.plugin) + oprot.writeMessageBegin("configurePlugin", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getPluginConfig(self, seqid, iprot, oprot): - args = getPluginConfig_args() + def process_saveConfig(self, seqid, iprot, oprot): + args = saveConfig_args() args.read(iprot) iprot.readMessageEnd() - result = getPluginConfig_result() - result.success = self._handler.getPluginConfig() - oprot.writeMessageBegin("getPluginConfig", TMessageType.REPLY, seqid) + result = saveConfig_result() + self._handler.saveConfig(args.config) + oprot.writeMessageBegin("saveConfig", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_configureSection(self, seqid, iprot, oprot): - args = configureSection_args() + def process_deleteConfig(self, seqid, iprot, oprot): + args = deleteConfig_args() args.read(iprot) iprot.readMessageEnd() - result = configureSection_result() - result.success = self._handler.configureSection(args.section) - oprot.writeMessageBegin("configureSection", TMessageType.REPLY, seqid) + result = deleteConfig_result() + self._handler.deleteConfig(args.config) + oprot.writeMessageBegin("deleteConfig", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -4071,12 +4095,23 @@ class Processor(Iface, TProcessor): args.read(iprot) iprot.readMessageEnd() result = updateAccount_result() - self._handler.updateAccount(args.plugin, args.account, args.password, args.options) + self._handler.updateAccount(args.plugin, args.account, args.password) oprot.writeMessageBegin("updateAccount", TMessageType.REPLY, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() + def process_updateAccountInfo(self, seqid, iprot, oprot): + args = updateAccountInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = updateAccountInfo_result() + self._handler.updateAccountInfo(args.account) + oprot.writeMessageBegin("updateAccountInfo", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_removeAccount(self, seqid, iprot, oprot): args = removeAccount_args() args.read(iprot) @@ -4542,7 +4577,7 @@ class toggleReconnect_result(TBase): self.success = success -class scanDownloadFolder_args(TBase): +class getConfig_args(TBase): __slots__ = [ ] @@ -4551,39 +4586,34 @@ class scanDownloadFolder_args(TBase): ) -class scanDownloadFolder_result(TBase): +class getConfig_result(TBase): + """ + Attributes: + - success + """ __slots__ = [ + 'success', ] thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(ConfigHolder, ConfigHolder.thrift_spec)), None, ), # 0 ) + def __init__(self, success=None,): + self.success = success -class getConfigValue_args(TBase): - """ - Attributes: - - section - - option - """ + +class getGlobalPlugins_args(TBase): __slots__ = [ - 'section', - 'option', ] thrift_spec = ( - None, # 0 - (1, TType.STRING, 'section', None, None, ), # 1 - (2, TType.STRING, 'option', None, None, ), # 2 ) - def __init__(self, section=None, option=None,): - self.section = section - self.option = option - -class getConfigValue_result(TBase): +class getGlobalPlugins_result(TBase): """ Attributes: - success @@ -4594,59 +4624,60 @@ class getConfigValue_result(TBase): ] thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 + (0, TType.LIST, 'success', (TType.STRUCT,(ConfigInfo, ConfigInfo.thrift_spec)), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class setConfigValue_args(TBase): - """ - Attributes: - - section - - option - - value - """ +class getUserPlugins_args(TBase): __slots__ = [ - 'section', - 'option', - 'value', ] thrift_spec = ( - None, # 0 - (1, TType.STRING, 'section', None, None, ), # 1 - (2, TType.STRING, 'option', None, None, ), # 2 - (3, TType.STRING, 'value', None, None, ), # 3 ) - def __init__(self, section=None, option=None, value=None,): - self.section = section - self.option = option - self.value = value - -class setConfigValue_result(TBase): +class getUserPlugins_result(TBase): + """ + Attributes: + - success + """ __slots__ = [ + 'success', ] thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(ConfigInfo, ConfigInfo.thrift_spec)), None, ), # 0 ) + def __init__(self, success=None,): + self.success = success + -class getConfig_args(TBase): +class configurePlugin_args(TBase): + """ + Attributes: + - plugin + """ __slots__ = [ + 'plugin', ] thrift_spec = ( + None, # 0 + (1, TType.STRING, 'plugin', None, None, ), # 1 ) + def __init__(self, plugin=None,): + self.plugin = plugin -class getConfig_result(TBase): + +class configurePlugin_result(TBase): """ Attributes: - success @@ -4657,76 +4688,68 @@ class getConfig_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(ConfigSection, ConfigSection.thrift_spec)), None, ), # 0 + (0, TType.STRUCT, 'success', (ConfigHolder, ConfigHolder.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): self.success = success -class getPluginConfig_args(TBase): +class saveConfig_args(TBase): + """ + Attributes: + - config + """ __slots__ = [ + 'config', ] thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'config', (ConfigHolder, ConfigHolder.thrift_spec), None, ), # 1 ) + def __init__(self, config=None,): + self.config = config -class getPluginConfig_result(TBase): - """ - Attributes: - - success - """ + +class saveConfig_result(TBase): __slots__ = [ - 'success', ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(ConfigSection, ConfigSection.thrift_spec)), None, ), # 0 ) - def __init__(self, success=None,): - self.success = success - -class configureSection_args(TBase): +class deleteConfig_args(TBase): """ Attributes: - - section + - config """ __slots__ = [ - 'section', + 'config', ] thrift_spec = ( None, # 0 - (1, TType.STRING, 'section', None, None, ), # 1 + (1, TType.STRUCT, 'config', (ConfigHolder, ConfigHolder.thrift_spec), None, ), # 1 ) - def __init__(self, section=None,): - self.section = section + def __init__(self, config=None,): + self.config = config -class configureSection_result(TBase): - """ - Attributes: - - success - """ +class deleteConfig_result(TBase): __slots__ = [ - 'success', ] thrift_spec = ( - (0, TType.STRUCT, 'success', (ConfigSection, ConfigSection.thrift_spec), None, ), # 0 ) - def __init__(self, success=None,): - self.success = success - class setConfigHandler_args(TBase): """ @@ -6693,14 +6716,12 @@ class updateAccount_args(TBase): - plugin - account - password - - options """ __slots__ = [ 'plugin', 'account', 'password', - 'options', ] thrift_spec = ( @@ -6708,14 +6729,12 @@ class updateAccount_args(TBase): (1, TType.STRING, 'plugin', None, None, ), # 1 (2, TType.STRING, 'account', None, None, ), # 2 (3, TType.STRING, 'password', None, None, ), # 3 - (4, TType.MAP, 'options', (TType.STRING,None,TType.STRING,None), None, ), # 4 ) - def __init__(self, plugin=None, account=None, password=None, options=None,): + def __init__(self, plugin=None, account=None, password=None,): self.plugin = plugin self.account = account self.password = password - self.options = options class updateAccount_result(TBase): @@ -6727,6 +6746,34 @@ class updateAccount_result(TBase): ) +class updateAccountInfo_args(TBase): + """ + Attributes: + - account + """ + + __slots__ = [ + 'account', + ] + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'account', (AccountInfo, AccountInfo.thrift_spec), None, ), # 1 + ) + + def __init__(self, account=None,): + self.account = account + + +class updateAccountInfo_result(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + class removeAccount_args(TBase): """ Attributes: diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index b61d4c479..815c80819 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -202,7 +202,7 @@ class Permission(TBase): Download = 8 Accounts = 16 Interaction = 32 - Addons = 64 + Plugins = 64 _VALUES_TO_NAMES = { 0: "All", @@ -212,7 +212,7 @@ class Permission(TBase): 8: "Download", 16: "Accounts", 32: "Interaction", - 64: "Addons", + 64: "Plugins", } _NAMES_TO_VALUES = { @@ -223,7 +223,7 @@ class Permission(TBase): "Download": 8, "Accounts": 16, "Interaction": 32, - "Addons": 64, + "Plugins": 64, } class Role(TBase): @@ -734,7 +734,7 @@ class ConfigItem(TBase): """ Attributes: - name - - display_name + - label - description - type - default_value @@ -743,7 +743,7 @@ class ConfigItem(TBase): __slots__ = [ 'name', - 'display_name', + 'label', 'description', 'type', 'default_value', @@ -753,27 +753,27 @@ class ConfigItem(TBase): thrift_spec = ( None, # 0 (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'display_name', None, None, ), # 2 + (2, TType.STRING, 'label', None, None, ), # 2 (3, TType.STRING, 'description', None, None, ), # 3 (4, TType.STRING, 'type', None, None, ), # 4 (5, TType.STRING, 'default_value', None, None, ), # 5 (6, TType.STRING, 'value', None, None, ), # 6 ) - def __init__(self, name=None, display_name=None, description=None, type=None, default_value=None, value=None,): + def __init__(self, name=None, label=None, description=None, type=None, default_value=None, value=None,): self.name = name - self.display_name = display_name + self.label = label self.description = description self.type = type self.default_value = default_value self.value = value -class ConfigSection(TBase): +class ConfigHolder(TBase): """ Attributes: - name - - display_name + - label - description - long_description - items @@ -783,7 +783,7 @@ class ConfigSection(TBase): __slots__ = [ 'name', - 'display_name', + 'label', 'description', 'long_description', 'items', @@ -794,7 +794,7 @@ class ConfigSection(TBase): thrift_spec = ( None, # 0 (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'display_name', None, None, ), # 2 + (2, TType.STRING, 'label', None, None, ), # 2 (3, TType.STRING, 'description', None, None, ), # 3 (4, TType.STRING, 'long_description', None, None, ), # 4 (5, TType.LIST, 'items', (TType.STRUCT,(ConfigItem, ConfigItem.thrift_spec)), None, ), # 5 @@ -802,9 +802,9 @@ class ConfigSection(TBase): (7, TType.LIST, 'handler', (TType.STRUCT,(InteractionTask, InteractionTask.thrift_spec)), None, ), # 7 ) - def __init__(self, name=None, display_name=None, description=None, long_description=None, items=None, info=None, handler=None,): + def __init__(self, name=None, label=None, description=None, long_description=None, items=None, info=None, handler=None,): self.name = name - self.display_name = display_name + self.label = label self.description = description self.long_description = long_description self.items = items @@ -812,6 +812,41 @@ class ConfigSection(TBase): self.handler = handler +class ConfigInfo(TBase): + """ + Attributes: + - name + - label + - description + - saved + - activated + """ + + __slots__ = [ + 'name', + 'label', + 'description', + 'saved', + 'activated', + ] + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.STRING, 'label', None, None, ), # 2 + (3, TType.STRING, 'description', None, None, ), # 3 + (4, TType.BOOL, 'saved', None, None, ), # 4 + (5, TType.BOOL, 'activated', None, None, ), # 5 + ) + + def __init__(self, name=None, label=None, description=None, saved=None, activated=None,): + self.name = name + self.label = label + self.description = description + self.saved = saved + self.activated = activated + + class EventInfo(TBase): """ Attributes: |