mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
implement new version of the dsa watcher
This commit is contained in:
@@ -26,7 +26,6 @@ def plugin_enabled_set(plugin, enabled):
|
||||
log.warn("couldn't get exclusive lock")
|
||||
|
||||
config.conf_set('persistent_locked', True)
|
||||
# blob = conf_load()
|
||||
|
||||
if plugin.plugin_name not in config.runtime_config_store['plugins']:
|
||||
config.runtime_config_store['plugins'][plugin.plugin_name] = {}
|
||||
@@ -36,6 +35,25 @@ def plugin_enabled_set(plugin, enabled):
|
||||
config.conf_set('persistent_locked', False)
|
||||
|
||||
|
||||
def register_active_event(t, callback, args, action_runner, plugin, msg_obj):
|
||||
"""
|
||||
Execute a callback at a given time and react on the output
|
||||
|
||||
:param t: when to execute the job
|
||||
:param callback: the function to execute
|
||||
:param args: parameters for said function
|
||||
:param action_runner: bots action dict parser
|
||||
:param plugin: pass-through object for action parser
|
||||
:param msg_obj: pass-through object for action parser
|
||||
:return:
|
||||
"""
|
||||
def func(func_args):
|
||||
action = callback(*func_args)
|
||||
if action:
|
||||
action_runner(action=action, plugin=plugin, msg_obj=msg_obj)
|
||||
joblist.append((t, func, args))
|
||||
|
||||
|
||||
def register_event(t, callback, args):
|
||||
joblist.append((t, callback, args))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user