From 850c373f1a61b135cf71d13b9cde9c4d41463f9b Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 4 Jul 2011 23:11:15 +0200 Subject: fixed some bugs, new externalscripts plugin --- module/Api.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'module/Api.py') 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 -- cgit v1.2.3