summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-04 13:28:13 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-04 13:28:13 +0200
commit1da74a9636e2b70457317a3c16387594977416fb (patch)
tree01128c8d9ff205930e4d58614ed6e16b47e82531
parentc162596f0041e2316ec5309382ccaa6e24e73560 (diff)
downloadpoezio-1da74a9636e2b70457317a3c16387594977416fb.tar.gz
poezio-1da74a9636e2b70457317a3c16387594977416fb.tar.bz2
poezio-1da74a9636e2b70457317a3c16387594977416fb.tar.xz
poezio-1da74a9636e2b70457317a3c16387594977416fb.zip
Simplify plugins path changes.
-rw-r--r--poezio/core/core.py18
-rw-r--r--poezio/plugin_manager.py8
2 files changed, 6 insertions, 20 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 37bf7752..bea42f11 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -321,9 +321,9 @@ class Core(object):
self.add_configuration_handler("ack_message_receipts",
self.on_ack_receipts_config_change)
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.on_plugins_conf_dir_config_change)
+ self.plugin_manager.on_plugins_conf_dir_change)
self.add_configuration_handler("connection_timeout_delay",
self.xmpp.set_keepalive_values)
self.add_configuration_handler("connection_check_interval",
@@ -414,26 +414,12 @@ class Core(object):
self.xmpp.plugin['xep_0184'].auto_ack = config.get(
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):
"""
Called when the enable_vertical_tab_list option is changed
"""
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):
"""
Called when the theme option is changed
diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py
index 8bcb7a3b..15f0db8a 100644
--- a/poezio/plugin_manager.py
+++ b/poezio/plugin_manager.py
@@ -313,13 +313,13 @@ class PluginManager(object):
'',
quotify=False)
- def on_plugins_dir_change(self, new_value):
- self.plugins_dir = new_value
+ def on_plugins_dir_change(self, _, new_value):
+ self.plugins_dir = Path(new_value).expanduser()
self.check_create_plugins_dir()
self.fill_load_path()
- def on_plugins_conf_dir_change(self, new_value):
- self.plugins_conf_dir = new_value
+ def on_plugins_conf_dir_change(self, _, new_value):
+ self.plugins_conf_dir = Path(new_value).expanduser()
self.check_create_plugins_conf_dir()
def initial_set_plugins_conf_dir(self):