summaryrefslogtreecommitdiffstats
path: root/module/Api.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-04 23:11:15 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-07-04 23:11:15 +0200
commit850c373f1a61b135cf71d13b9cde9c4d41463f9b (patch)
treed6c0bd18be3818ae1244b8b52516f03bc3c53c53 /module/Api.py
parentclosed #338 (diff)
downloadpyload-850c373f1a61b135cf71d13b9cde9c4d41463f9b.tar.xz
fixed some bugs, new externalscripts plugin
Diffstat (limited to 'module/Api.py')
-rw-r--r--module/Api.py24
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