Simplify plugins path changes.

This commit is contained in:
Emmanuel Gil Peyrot 2018-07-04 13:28:13 +02:00
parent c162596f00
commit 1da74a9636
2 changed files with 6 additions and 20 deletions

View file

@ -321,9 +321,9 @@ class Core(object):
self.add_configuration_handler("ack_message_receipts", self.add_configuration_handler("ack_message_receipts",
self.on_ack_receipts_config_change) self.on_ack_receipts_config_change)
self.add_configuration_handler("plugins_dir", self.add_configuration_handler("plugins_dir",
self.on_plugins_dir_config_change) self.plugin_manager.on_plugins_dir_change)
self.add_configuration_handler("plugins_conf_dir", self.add_configuration_handler("plugins_conf_dir",
self.on_plugins_conf_dir_config_change) self.plugin_manager.on_plugins_conf_dir_change)
self.add_configuration_handler("connection_timeout_delay", self.add_configuration_handler("connection_timeout_delay",
self.xmpp.set_keepalive_values) self.xmpp.set_keepalive_values)
self.add_configuration_handler("connection_check_interval", self.add_configuration_handler("connection_check_interval",
@ -414,26 +414,12 @@ class Core(object):
self.xmpp.plugin['xep_0184'].auto_ack = config.get( self.xmpp.plugin['xep_0184'].auto_ack = config.get(
option, default=True) option, default=True)
def on_plugins_dir_config_change(self, option, value):
"""
Called when the plugins_dir option is changed
"""
path = os.path.expanduser(value)
self.plugin_manager.on_plugins_dir_change(path)
def on_vertical_tab_list_config_change(self, option, value): def on_vertical_tab_list_config_change(self, option, value):
""" """
Called when the enable_vertical_tab_list option is changed Called when the enable_vertical_tab_list option is changed
""" """
self.call_for_resize() self.call_for_resize()
def on_plugins_conf_dir_config_change(self, option, value):
"""
Called when the plugins_conf_dir option is changed
"""
path = os.path.expanduser(value)
self.plugin_manager.on_plugins_conf_dir_change(path)
def on_theme_config_change(self, option, value): def on_theme_config_change(self, option, value):
""" """
Called when the theme option is changed Called when the theme option is changed

View file

@ -313,13 +313,13 @@ class PluginManager(object):
'', '',
quotify=False) quotify=False)
def on_plugins_dir_change(self, new_value): def on_plugins_dir_change(self, _, new_value):
self.plugins_dir = new_value self.plugins_dir = Path(new_value).expanduser()
self.check_create_plugins_dir() self.check_create_plugins_dir()
self.fill_load_path() self.fill_load_path()
def on_plugins_conf_dir_change(self, new_value): def on_plugins_conf_dir_change(self, _, new_value):
self.plugins_conf_dir = new_value self.plugins_conf_dir = Path(new_value).expanduser()
self.check_create_plugins_conf_dir() self.check_create_plugins_conf_dir()
def initial_set_plugins_conf_dir(self): def initial_set_plugins_conf_dir(self):