diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-03-20 14:57:45 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-03-20 14:57:45 +0100 |
commit | 50d4df8b4d48b855bd18e9922355b7f3f2b4da4e (patch) | |
tree | 6301b05677a90cf86f131d5a7ae3f879b38e84d2 /module/remote | |
parent | renamed hooks to addons, new filemanager and database, many new api methods (diff) | |
download | pyload-50d4df8b4d48b855bd18e9922355b7f3f2b4da4e.tar.xz |
captcha decrypting for all plugin types, new interaction manager
Diffstat (limited to 'module/remote')
-rw-r--r-- | module/remote/socketbackend/ttypes.py | 2 | ||||
-rw-r--r-- | module/remote/thriftbackend/pyload.thrift | 3 | ||||
-rwxr-xr-x | module/remote/thriftbackend/thriftgen/pyload/Pyload-remote | 7 | ||||
-rw-r--r-- | module/remote/thriftbackend/thriftgen/pyload/Pyload.py | 67 |
4 files changed, 78 insertions, 1 deletions
diff --git a/module/remote/socketbackend/ttypes.py b/module/remote/socketbackend/ttypes.py index 91430d720..1fd61ae72 100644 --- a/module/remote/socketbackend/ttypes.py +++ b/module/remote/socketbackend/ttypes.py @@ -367,6 +367,8 @@ class Iface: pass def getLog(self, offset): pass + def getNotifications(self): + pass def getPackageContent(self, pid): pass def getPackageInfo(self, pid): diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index bcf96324c..df82dae2d 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -415,8 +415,9 @@ service Pyload { // generate a download link, everybody can download the file until timeout reached string generateDownloadLink(1: FileID fid, 2: i16 timeout), - map<PluginName, list<AddonService>> getAddonHandler(), + list<InteractionTask> getNotifications(), + map<PluginName, list<AddonService>> getAddonHandler(), void callAddonHandler(1: PluginName plugin, 2: string func, 3: PackageID pid_or_fid), /////////////////////// diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index 6f0c09182..55f9a1823 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -91,6 +91,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' InteractionTask getInteractionTask(i16 mode)' print ' void setInteractionResult(InteractionID iid, ValueString 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)' @@ -565,6 +566,12 @@ elif cmd == 'generateDownloadLink': sys.exit(1) pp.pprint(client.generateDownloadLink(eval(args[0]),eval(args[1]),)) +elif cmd == 'getNotifications': + if len(args) != 0: + print 'getNotifications requires 0 args' + sys.exit(1) + pp.pprint(client.getNotifications()) + elif cmd == 'getAddonHandler': if len(args) != 0: print 'getAddonHandler requires 0 args' diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index e58070a59..51c8621ba 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -450,6 +450,9 @@ class Iface(object): """ pass + def getNotifications(self, ): + pass + def getAddonHandler(self, ): pass @@ -2542,6 +2545,31 @@ class Client(Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "generateDownloadLink failed: unknown result"); + def getNotifications(self, ): + self.send_getNotifications() + return self.recv_getNotifications() + + def send_getNotifications(self, ): + self._oprot.writeMessageBegin('getNotifications', TMessageType.CALL, self._seqid) + args = getNotifications_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getNotifications(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getNotifications_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getNotifications failed: unknown result"); + def getAddonHandler(self, ): self.send_getAddonHandler() return self.recv_getAddonHandler() @@ -3062,6 +3090,7 @@ class Processor(Iface, TProcessor): 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 @@ -3868,6 +3897,17 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_getNotifications(self, seqid, iprot, oprot): + args = getNotifications_args() + args.read(iprot) + iprot.readMessageEnd() + result = getNotifications_result() + result.success = self._handler.getNotifications() + oprot.writeMessageBegin("getNotifications", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_getAddonHandler(self, seqid, iprot, oprot): args = getAddonHandler_args() args.read(iprot) @@ -6350,6 +6390,33 @@ class generateDownloadLink_result(TBase): self.success = success +class getNotifications_args(TBase): + + __slots__ = [ + ] + + thrift_spec = ( + ) + + +class getNotifications_result(TBase): + """ + Attributes: + - success + """ + + __slots__ = [ + 'success', + ] + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(InteractionTask, InteractionTask.thrift_spec)), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + class getAddonHandler_args(TBase): __slots__ = [ |