summaryrefslogtreecommitdiffstats
path: root/pyload/api/AddonApi.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/api/AddonApi.py')
-rw-r--r--pyload/api/AddonApi.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/pyload/api/AddonApi.py b/pyload/api/AddonApi.py
new file mode 100644
index 000000000..4ae686d2d
--- /dev/null
+++ b/pyload/api/AddonApi.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from pyload.Api import Api, RequirePerm, Permission
+
+from ApiComponent import ApiComponent
+
+class AddonApi(ApiComponent):
+ """ Methods to interact with addons """
+
+ def getAllInfo(self):
+ """Returns all information stored by addon plugins. Values are always strings
+
+ :return: {"plugin": {"name": value } }
+ """
+ return self.core.addonManager.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}
+ """
+ return self.core.addonManager.getInfo(plugin)
+
+if Api.extend(AddonApi):
+ del AddonApi \ No newline at end of file