Fix path building for config dir and data dir

The paths are now correctly built in the case where $XDG_DATA_HOME and
$XDG_CONFIG_HOME are not empty: the "weboob/" suffix was in the fallback
argument of the os.get.environ.

Signed-off-by: Olivier Schwander <olivier.schwander@ens-lyon.org>
Signed-off-by: Romain Bignon <romain@symlink.me>
This commit is contained in:
Olivier Schwander 2012-02-16 21:07:49 +01:00 committed by Romain Bignon
commit 825dc0b5b1

View file

@ -58,8 +58,8 @@ class Weboob(object):
datadir = workdir = os.environ.get('WEBOOB_WORKDIR')
else:
old_workdir = os.path.join(os.path.expanduser('~'), '.weboob')
xdg_config_home = os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config', 'weboob'))
xdg_data_home = os.environ.get('XDG_DATA_HOME', os.path.join(os.path.expanduser('~'), '.local', 'share', 'weboob'))
xdg_config_home = os.path.join(os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), '.config')), 'weboob')
xdg_data_home = os.path.join(os.environ.get('XDG_DATA_HOME', os.path.join(os.path.expanduser('~'), '.local')), 'share', 'weboob')
if os.path.isdir(old_workdir):
self.logger.warning('You are using "%s" as working directory. Files are moved into %s and %s.'