From 00ed9b4842169111238b86d0bfc1465176b7d2d8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 25 Sep 2011 03:01:32 +0200 Subject: [teisenbe] Fix a bug in case of XDG_CONFIG_HOME not set --- src/plugin_manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugin_manager.py') diff --git a/src/plugin_manager.py b/src/plugin_manager.py index 0ffee7ee..1f0e89eb 100644 --- a/src/plugin_manager.py +++ b/src/plugin_manager.py @@ -10,8 +10,10 @@ plugins_dir = plugins_dir or\ os.path.join(os.environ.get('HOME'), '.local', 'share'), 'poezio', 'plugins') -plugins_conf_dir = os.path.join(os.environ.get('XDG_CONFIG_HOME'), 'poezio',\ - 'plugins') +config_home = os.environ.get("XDG_CONFIG_HOME") +if not config_home: + config_home = os.path.join(os.environ.get('HOME'), '.config') +plugins_conf_dir = os.path.join(config_home, 'poezio', 'plugins') try: os.makedirs(plugins_dir) @@ -23,7 +25,6 @@ try: except OSError: pass - sys.path.append(plugins_dir) class PluginManager(object): -- cgit v1.2.3