summaryrefslogtreecommitdiffstats
path: root/module/Api.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-03-20 14:57:45 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-03-20 14:57:45 +0100
commit50d4df8b4d48b855bd18e9922355b7f3f2b4da4e (patch)
tree6301b05677a90cf86f131d5a7ae3f879b38e84d2 /module/Api.py
parentrenamed hooks to addons, new filemanager and database, many new api methods (diff)
downloadpyload-50d4df8b4d48b855bd18e9922355b7f3f2b4da4e.tar.xz
captcha decrypting for all plugin types, new interaction manager
Diffstat (limited to 'module/Api.py')
-rw-r--r--module/Api.py35
1 files changed, 31 insertions, 4 deletions
diff --git a/module/Api.py b/module/Api.py
index 84712af18..6d7ac75b6 100644
--- a/module/Api.py
+++ b/module/Api.py
@@ -766,18 +766,45 @@ class Api(Iface):
# User Interaction
#############################
-
@permission(PERMS.INTERACTION)
def isInteractionWaiting(self, mode):
- pass
+ """ Check if task is waiting.
+
+ :param mode: binary or'ed output type
+ :return: boolean
+ """
+ return self.core.interactionManager.isTaskWaiting(mode)
@permission(PERMS.INTERACTION)
def getInteractionTask(self, mode):
- pass
+ """Retrieve task for specific mode.
+
+ :param mode: binary or'ed output type
+ :return: :class:`InteractionTask`
+ """
+ task = self.core.interactionManager.getTask(mode)
+ return InteractionTask(-1) if not task else task
+
@permission(PERMS.INTERACTION)
def setInteractionResult(self, iid, result):
- pass
+ """Set Result for a interaction task. It will be immediately removed from task queue afterwards
+
+ :param iid: interaction id
+ :param result: result as string
+ """
+ task = self.core.interactionManager.getTaskByID(iid)
+ if task:
+ task.setResult(result)
+
+ @permission(PERMS.INTERACTION)
+ def getNotifications(self):
+ """List of all available notifcations. They stay in queue for some time, client should\
+ save which notifications it already has seen.
+
+ :return: list of :class:`InteractionTask`
+ """
+ return self.core.interactionManager.getNotifications()
@permission(PERMS.INTERACTION)
def getAddonHandler(self):