Skip to content
Snippets Groups Projects
Commit 8d8c8a7f authored by Éric Araujo's avatar Éric Araujo
Browse files

look at environment variables by hand if PyXDG isn't available. see #2149

parent 00db7df8
No related branches found
No related tags found
No related merge requests found
......@@ -103,9 +103,13 @@ class ConfigPaths:
self.data_root = os.path.join(xdg.BaseDirectory.\
xdg_data_dirs[0], u'gajim')
else:
self.config_root = os.path.expanduser(u'~/.config/gajim')
self.cache_root = os.path.expanduser(u'~/.cache/gajim')
self.data_root = os.path.expanduser(u'~/.local/share/gajim')
expand = os.path.expanduser
base = os.getenv('XDG_CONFIG_HOME') or expand(u'~/.config')
self.config_root = os.path.join(base, u'gajim')
base = os.getenv('XDG_CACHE_HOME') or expand(u'~/.cache')
self.cache_root = os.path.join(base, u'gajim')
base = os.getenv('XDG_DATA_HOME') or expand(u'~/.local/share')
self.data_root = os.path.join(base, u'gajim')
def add(self, name, type_, path):
self.paths[name] = (type_, path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment