diff options
Diffstat (limited to 'module/Api.py')
-rw-r--r-- | module/Api.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/module/Api.py b/module/Api.py index d4dae3966..2f6200950 100644 --- a/module/Api.py +++ b/module/Api.py @@ -277,7 +277,8 @@ class Api(Iface): raise PackageDoesNotExists(pid) pdata = PackageData(data["id"], data["name"], data["folder"], data["site"], data["password"], - data["queue"], data["order"], data["priority"], fids=[int(x) for x in data["links"]]) + data["queue"], data["order"], data["priority"], + fids=[int(x) for x in data["links"]]) return pdata @@ -723,4 +724,23 @@ class Api(Iface): ret = self.core.hookManager.callRPC(plugin, func, args, parse) return str(ret) except Exception, e: - raise ServiceException(e.message)
\ No newline at end of file + raise ServiceException(e.message) + + def getAllInfo(self): + """Returns all information stored by hook plugins. Values are always strings + + :return: {"plugin": {"name": value } } + """ + return self.core.hookManager.getAllInfo() + + def getInfoByPlugin(self, plugin): + """Returns information stored by a specific plugin. + + :param plugin: pluginname + :return: dict of attr names mapped to value {"name": value} + """ + info = self.core.hookManager.getAllInfo() + if info.has_key(plugin): + return info[plugin] + else: + return {}
\ No newline at end of file |