Fix #2719 (write/read in the plugin config files even when not loaded)
This commit is contained in:
parent
6b8af2413e
commit
9d58c9d32e
1 changed files with 14 additions and 6 deletions
|
@ -6,6 +6,7 @@ import logging
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
@ -23,6 +24,7 @@ import tabs
|
||||||
from common import safeJID
|
from common import safeJID
|
||||||
from config import config, options as config_opts
|
from config import config, options as config_opts
|
||||||
import multiuserchat as muc
|
import multiuserchat as muc
|
||||||
|
from plugin import PluginConfig
|
||||||
from roster import roster
|
from roster import roster
|
||||||
from theming import dump_tuple, get_theme
|
from theming import dump_tuple, get_theme
|
||||||
|
|
||||||
|
@ -600,9 +602,12 @@ def command_set(self, arg):
|
||||||
section = plugin_name
|
section = plugin_name
|
||||||
option = args[1]
|
option = args[1]
|
||||||
if not plugin_name in self.plugin_manager.plugins:
|
if not plugin_name in self.plugin_manager.plugins:
|
||||||
return
|
file_name = self.plugin_manager.plugins_conf_dir
|
||||||
plugin = self.plugin_manager.plugins[plugin_name]
|
file_name = os.path.join(file_name, plugin_name + '.cfg')
|
||||||
value = plugin.config.get(option, default='', section=section)
|
plugin_config = PluginConfig(file_name, plugin_name)
|
||||||
|
else:
|
||||||
|
plugin_config = self.plugin_manager.plugins[plugin_name].config
|
||||||
|
value = plugin_config.get(option, default='', section=section)
|
||||||
info = ('%s=%s' % (option, value), 'Info')
|
info = ('%s=%s' % (option, value), 'Info')
|
||||||
else:
|
else:
|
||||||
possible_section = args[0]
|
possible_section = args[0]
|
||||||
|
@ -624,9 +629,12 @@ def command_set(self, arg):
|
||||||
option = args[1]
|
option = args[1]
|
||||||
value = args[2]
|
value = args[2]
|
||||||
if not plugin_name in self.plugin_manager.plugins:
|
if not plugin_name in self.plugin_manager.plugins:
|
||||||
return
|
file_name = self.plugin_manager.plugins_conf_dir
|
||||||
plugin = self.plugin_manager.plugins[plugin_name]
|
file_name = os.path.join(file_name, plugin_name + '.cfg')
|
||||||
info = plugin.config.set_and_save(option, value, section)
|
plugin_config = PluginConfig(file_name, plugin_name)
|
||||||
|
else:
|
||||||
|
plugin_config = self.plugin_manager.plugins[plugin_name].config
|
||||||
|
info = plugin_config.set_and_save(option, value, section)
|
||||||
else:
|
else:
|
||||||
section = args[0]
|
section = args[0]
|
||||||
option = args[1]
|
option = args[1]
|
||||||
|
|
Loading…
Reference in a new issue