Make some paths available before profile init

This commit is contained in:
Philipp Hörist 2017-01-06 17:44:31 +01:00
parent 277e13bdd8
commit c4e41d6997
1 changed files with 9 additions and 8 deletions

View File

@ -97,6 +97,13 @@ class ConfigPaths:
base = expand('~/.local/share') base = expand('~/.local/share')
self.data_root = os.path.join(base, 'gajim') self.data_root = os.path.join(base, 'gajim')
basedir = fse(os.environ.get('GAJIM_BASEDIR', defs.basedir))
self.add('DATA', None, os.path.join(basedir, windowsify('data')))
self.add('ICONS', None, os.path.join(basedir, windowsify('icons')))
self.add('HOME', None, fse(os.path.expanduser('~')))
self.add('PLUGINS_BASE', None,
os.path.join(basedir, windowsify('plugins')))
def add(self, name, type_, path): def add(self, name, type_, path):
self.paths[name] = (type_, path) self.paths[name] = (type_, path)
@ -159,12 +166,6 @@ class ConfigPaths:
else: else:
self.add('MY_CONFIG', TYPE_CONFIG, '') self.add('MY_CONFIG', TYPE_CONFIG, '')
basedir = fse(os.environ.get('GAJIM_BASEDIR', defs.basedir))
self.add('DATA', None, os.path.join(basedir, windowsify('data')))
self.add('ICONS', None, os.path.join(basedir, windowsify('icons')))
self.add('HOME', None, fse(os.path.expanduser('~')))
self.add('PLUGINS_BASE', None, os.path.join(basedir,
windowsify('plugins')))
try: try:
self.add('TMP', None, fse(tempfile.gettempdir())) self.add('TMP', None, fse(tempfile.gettempdir()))
except IOError as e: except IOError as e: