diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-18 00:06:18 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-18 00:06:18 +0200 |
commit | 5c1fb051fcbc7842bb4f6e879684cda9d7a14cdb (patch) | |
tree | 44fccf0954de54947397bfac76633d9f0e6c48a6 /module/remote | |
parent | improvements, command line link checker (diff) | |
download | pyload-5c1fb051fcbc7842bb4f6e879684cda9d7a14cdb.tar.xz |
closed #364, changes to online check api
Diffstat (limited to 'module/remote')
4 files changed, 47 insertions, 12 deletions
diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift index 2995ce207..d73021725 100644 --- a/module/remote/thriftbackend/pyload.thrift +++ b/module/remote/thriftbackend/pyload.thrift @@ -160,10 +160,17 @@ struct ServiceCall { struct OnlineStatus { 1: string name, 2: PluginName plugin, - 3: DownloadStatus status, - 4: i64 size, // size <= 0 : unknown + 3: string packagename, + 4: DownloadStatus status, + 5: i64 size, // size <= 0 : unknown } +struct OnlineCheck { + 1: ResultID rid, // -1 -> nothing more to get + 2: map<string, OnlineStatus> data, //url to result +} + + // exceptions exception PackageDoesNotExists{ @@ -213,9 +220,10 @@ service Pyload { map<PluginName, LinkList> parseURLs(1: string html), // parses results and generates packages - ResultID checkOnlineStatus(1: LinkList urls), - // poll results from previosly started online check , packagename - url - status - map<string, map<string, OnlineStatus>> pollResults(1: ResultID rid), + OnlineCheck checkOnlineStatus(1: LinkList urls), + + // poll results from previosly started online check + OnlineCheck pollResults(1: ResultID rid), // downloads - information list<DownloadInfo> statusDownloads(), diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote index 0c0e70bd4..cdae7ac2a 100755 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote @@ -42,8 +42,8 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print ' generatePackages(LinkList links)' print ' checkURLs(LinkList urls)' print ' parseURLs(string html)' - print ' ResultID checkOnlineStatus(LinkList urls)' - print ' pollResults(ResultID rid)' + print ' OnlineCheck checkOnlineStatus(LinkList urls)' + print ' OnlineCheck pollResults(ResultID rid)' print ' statusDownloads()' print ' PackageData getPackageData(PackageID pid)' print ' PackageData getPackageInfo(PackageID pid)' diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py index 009d850c2..008c42a56 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py @@ -3777,7 +3777,7 @@ class checkOnlineStatus_result(TBase): ] thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 + (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): @@ -3814,7 +3814,7 @@ class pollResults_result(TBase): ] thrift_spec = ( - (0, TType.MAP, 'success', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.STRUCT,(OnlineStatus, OnlineStatus.thrift_spec))), None, ), # 0 + (0, TType.STRUCT, 'success', (OnlineCheck, OnlineCheck.thrift_spec), None, ), # 0 ) def __init__(self, success=None,): diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py index f7052bc28..e5d22805e 100644 --- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py @@ -606,6 +606,7 @@ class OnlineStatus(TBase): Attributes: - name - plugin + - packagename - status - size """ @@ -613,6 +614,7 @@ class OnlineStatus(TBase): __slots__ = [ 'name', 'plugin', + 'packagename', 'status', 'size', ] @@ -621,17 +623,42 @@ class OnlineStatus(TBase): None, # 0 (1, TType.STRING, 'name', None, None, ), # 1 (2, TType.STRING, 'plugin', None, None, ), # 2 - (3, TType.I32, 'status', None, None, ), # 3 - (4, TType.I64, 'size', None, None, ), # 4 + (3, TType.STRING, 'packagename', None, None, ), # 3 + (4, TType.I32, 'status', None, None, ), # 4 + (5, TType.I64, 'size', None, None, ), # 5 ) - def __init__(self, name=None, plugin=None, status=None, size=None,): + def __init__(self, name=None, plugin=None, packagename=None, status=None, size=None,): self.name = name self.plugin = plugin + self.packagename = packagename self.status = status self.size = size +class OnlineCheck(TBase): + """ + Attributes: + - rid + - data + """ + + __slots__ = [ + 'rid', + 'data', + ] + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'rid', None, None, ), # 1 + (2, TType.MAP, 'data', (TType.STRING,None,TType.STRUCT,(OnlineStatus, OnlineStatus.thrift_spec)), None, ), # 2 + ) + + def __init__(self, rid=None, data=None,): + self.rid = rid + self.data = data + + class PackageDoesNotExists(TExceptionBase): """ Attributes: |