1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

patch by braph: use decorator for config lock, drop IPC lock

This commit is contained in:
Thorsten
2016-04-03 21:20:14 +02:00
parent 89db85ad59
commit fca53d869f
5 changed files with 27 additions and 33 deletions

View File

@@ -5,7 +5,7 @@ import traceback
import types
import config
from common import RATE_NO_LIMIT, pluginfunction, ptypes_PARSE, ptypes_COMMAND, ptypes_MUC_ONLINE, ptypes
from common import RATE_NO_LIMIT, pluginfunction, config_locked, ptypes_PARSE, ptypes_COMMAND, ptypes_MUC_ONLINE, ptypes
from plugins import commands, parsers, muc_online
joblist = []
@@ -21,18 +21,14 @@ def plugin_enabled_get(urlbot_plugin):
return urlbot_plugin.is_enabled
@config_locked
def plugin_enabled_set(plugin, enabled):
if config.conf_get('persistent_locked'):
log.warn("couldn't get exclusive lock")
config.conf_set('persistent_locked', True)
if plugin.plugin_name not in config.runtime_config_store['plugins']:
config.runtime_config_store['plugins'][plugin.plugin_name] = {}
config.runtime_config_store['plugins'][plugin.plugin_name]['enabled'] = enabled
config.runtimeconf_persist()
config.conf_set('persistent_locked', False)
def register_active_event(t, callback, args, action_runner, plugin, msg_obj):