diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-11-25 22:57:33 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-11-25 22:57:33 +0100 |
commit | 10bd0793f4dc0191d97da390a43552a272c8290e (patch) | |
tree | 87b62f81e62b630a89e80beabdec5dd54a359338 /pyload/api | |
parent | render addon menu for packages (diff) | |
download | pyload-10bd0793f4dc0191d97da390a43552a272c8290e.tar.xz |
invoke addons via context menu
Diffstat (limited to 'pyload/api')
-rw-r--r-- | pyload/api/AddonApi.py | 8 | ||||
-rw-r--r-- | pyload/api/FileApi.py | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/pyload/api/AddonApi.py b/pyload/api/AddonApi.py index 7a1a651fc..cb82781b1 100644 --- a/pyload/api/AddonApi.py +++ b/pyload/api/AddonApi.py @@ -39,14 +39,14 @@ class AddonApi(ApiComponent): return handler @RequirePerm(Permission.Interaction) - def callAddon(self, plugin, func, arguments): + def invokeAddon(self, plugin, func, func_args): """ Calls any function exposed by an addon """ - pass + return self.core.addonManager.invoke(plugin, func, func_args) @RequirePerm(Permission.Interaction) - def callAddonHandler(self, plugin, func, pid_or_fid): + def invokeAddonHandler(self, plugin, func, pid_or_fid): """ Calls an addon handler registered to work with packages or files """ - pass + return self.invokeAddon(plugin, func, (pid_or_fid, )) if Api.extend(AddonApi): diff --git a/pyload/api/FileApi.py b/pyload/api/FileApi.py index 984729b8c..5bb8e21e7 100644 --- a/pyload/api/FileApi.py +++ b/pyload/api/FileApi.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from pyload.Api import Api, RequirePerm, Permission, DownloadState, PackageDoesNotExists, FileDoesNotExists +from pyload.Api import Api, RequirePerm, Permission, DownloadState, PackageDoesNotExist, FileDoesNotExist from pyload.utils import uniqify from ApiComponent import ApiComponent @@ -52,12 +52,12 @@ class FileApi(ApiComponent): """Returns information about package, without detailed information about containing files :param pid: package id - :raises PackageDoesNotExists: + :raises PackageDoesNotExist: :return: :class:`PackageInfo` """ info = self.core.files.getPackageInfo(pid) if not info: - raise PackageDoesNotExists(pid) + raise PackageDoesNotExist(pid) return info @RequirePerm(Permission.All) @@ -65,13 +65,13 @@ class FileApi(ApiComponent): """ Info for specific file :param fid: file id - :raises FileDoesNotExists: + :raises FileDoesNotExist: :return: :class:`FileInfo` """ info = self.core.files.getFileInfo(fid) if not info: - raise FileDoesNotExists(fid) + raise FileDoesNotExist(fid) return info def getFilePath(self, fid): @@ -103,7 +103,7 @@ class FileApi(ApiComponent): """ pid = pack.pid p = self.core.files.getPackage(pid) - if not p: raise PackageDoesNotExists(pid) + if not p: raise PackageDoesNotExist(pid) #TODO: fix for key, value in data.iteritems(): @@ -124,7 +124,7 @@ class FileApi(ApiComponent): :param pid: package id :param root: package id of new root - :raises PackageDoesNotExists: When pid or root is missing + :raises PackageDoesNotExist: When pid or root is missing :return: False if package can't be moved """ return self.core.files.movePackage(pid, root) |