summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-03 12:41:02 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-03 12:41:02 +0200
commit7978481edf172fa6d308932a640e1a9bccdd0d4f (patch)
tree5b1f998e53d7d6b7bcb435ca771f943bc3d8d3ec
parentb80bb2fcfcceb9b00a3fec02280e93da33ba8bd0 (diff)
downloadpoezio-7978481edf172fa6d308932a640e1a9bccdd0d4f.tar.gz
poezio-7978481edf172fa6d308932a640e1a9bccdd0d4f.tar.bz2
poezio-7978481edf172fa6d308932a640e1a9bccdd0d4f.tar.xz
poezio-7978481edf172fa6d308932a640e1a9bccdd0d4f.zip
Use the new config.get_default_config_dir() in plugin_manager.
-rw-r--r--poezio/plugin_manager.py10
1 files changed, 4 insertions, 6 deletions
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',