From 7978481edf172fa6d308932a640e1a9bccdd0d4f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 3 Jul 2018 12:41:02 +0200 Subject: Use the new config.get_default_config_dir() in plugin_manager. --- poezio/plugin_manager.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'poezio') diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py index cd13e6d8..bb629e0a 100644 --- a/poezio/plugin_manager.py +++ b/poezio/plugin_manager.py @@ -327,11 +327,9 @@ class PluginManager(object): """ plugins_conf_dir = config.get('plugins_conf_dir') if not plugins_conf_dir: - config_home = os.environ.get('XDG_CONFIG_HOME') - if not config_home: - config_home = path.join(os.environ.get('HOME'), '.config') - plugins_conf_dir = path.join(config_home, 'poezio', 'plugins') - self.plugins_conf_dir = path.expanduser(plugins_conf_dir) + self.plugins_conf_dir = config.get_default_config_dir() / 'plugins' + else: + self.plugins_conf_dir = Path(plugins_conf_dir).expanduser() self.check_create_plugins_conf_dir() def check_create_plugins_conf_dir(self): @@ -341,7 +339,7 @@ class PluginManager(object): """ if not os.access(self.plugins_conf_dir, os.R_OK | os.X_OK): try: - os.makedirs(self.plugins_conf_dir) + self.plugins_conf_dir.mkdir(parents=True, exist_ok=True) except OSError: log.error( 'Unable to create the plugin conf dir: %s', -- cgit v1.2.3