diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-08 23:09:13 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-07-08 23:09:13 +0200 |
commit | aa6aec1210a0f3d7f35071b403e97224ef1a4e71 (patch) | |
tree | 0d4ff9b506a910e15d912622f55aa6bb57e76718 /module/HookManager.py | |
parent | calculate queue count, db improvements (diff) | |
download | pyload-aa6aec1210a0f3d7f35071b403e97224ef1a4e71.tar.xz |
new useful events, allDownloadsProcessed + allDownloadsFinished
Diffstat (limited to 'module/HookManager.py')
-rw-r--r-- | module/HookManager.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/module/HookManager.py b/module/HookManager.py index 13e8695c2..393db2de6 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -28,7 +28,32 @@ from module.plugins.PluginManager import literal_eval from utils import lock class HookManager: - """Manages hooks and delegates and handles Events""" + """Manages hooks, delegates and handles Events. + + Every plugin can define events, \ + but some very usefull events are called by the Core. + Contrary to overwriting hook methods you can use event listener, + which provides additional entry point in the control flow. + Only use very short tasks or use threads. + + *Known Events:* + All hook methods exists as events. + downloadPreparing: A download was just queued and will be prepared now. + Argument: fid + + downloadStarts: A file will immediately starts the download afterwards. + Argument: fid + + linksAdded: Someone just added links, you are able to modify the links. + Arguments: links, pid + + allDownloadsProcessed: Every link was handled, pyload would idle afterwards. + + allDownloadsFinished: Every download in queue is finished. + + Note: allDownloadsProcessed is *always* called before allDownloadsFinished. + + """ def __init__(self, core): self.core = core |