diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-03 21:00:58 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-01-03 21:00:58 +0100 |
commit | 7c6374b4b5d452ab239f8b725038f2a2eb82368f (patch) | |
tree | 392f5809fb908eb7f22dffd273821bcc831da3dc /module/api/AddonApi.py | |
parent | seperate api into several components (diff) | |
download | pyload-7c6374b4b5d452ab239f8b725038f2a2eb82368f.tar.xz |
split api into more components
Diffstat (limited to 'module/api/AddonApi.py')
-rw-r--r-- | module/api/AddonApi.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/module/api/AddonApi.py b/module/api/AddonApi.py new file mode 100644 index 000000000..917c7dc4c --- /dev/null +++ b/module/api/AddonApi.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.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 |