Skip to content

module.HookManager.HookManager

Jonas edited this page Jun 8, 2016 · 1 revision

class module.HookManager. HookManager(core)

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 do very short tasks or use threads.

Known Events: Most hook methods exists as events. These are the additional known events.

Name Arguments Description
downloadPreparing fid A download was just queued and will be prepared now.
downloadStarts fid A plugin will immediately starts the download afterwards.
linksAdded links, pid Someone just added links, you are able to modify the links.
allDownloadsProcessed Every link was handled, pyload would idle afterwards.
allDownloadsFinished Every download in queue is finished.
unrarFinished folder, fname An Unrar job finished
configChanged The config was changed via the api.
pluginConfigChanged The plugin config changed, due to api or internal process.

Notes:

allDownloadsProcessed is always called before allDownloadsFinished.

configChanged is always called before pluginConfigChanged. __init__(core)

The whole SourceCode can be found here: (SourceCode)


Methods

Name Description
__init__(core)
activateHook(plugin)
activePlugins() returns all active plugins
addEvent(event, func) Adds an event listener for event name
addRPC(plugin, func, doc)
afterReconnecting(*args)
beforeReconnecting(*args)
callRPC(plugin, func, args, parse)
coreExiting(*args)
coreReady(*args)
createIndex()
deactivateHook(plugin)
dispatchEvent(event, *args) dispatches event with args
downloadFailed(*args)
downloadFinished(*args)
downloadPreparing(*args)
getAllInfo() returns info stored by hook plugins
getInfo(plugin)
manageHooks(plugin, name, value)
packageFinished(*args)
removeEvent(event, func) removes previously added event listener
startThread(function, *args, **kwargs)
try_catch(func)

The whole SourceCode can be found here: (SourceCode)


####activePlugins()

returns all active plugins


####getAllInfo()

returns info stored by hook plugins


####addEvent(event, func)

Adds an event listener for event name


####removeEvent(event, func)

removes previously added event listener


####dispatchEvent(event, *args)

dispatches event with args

Clone this wiki locally