Commit c4e41d69 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Make some paths available before profile init

parent 277e13bd
...@@ -97,6 +97,13 @@ class ConfigPaths: ...@@ -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)
...@@ -125,12 +132,12 @@ class ConfigPaths: ...@@ -125,12 +132,12 @@ class ConfigPaths:
self.config_root = self.cache_root = self.data_root = root self.config_root = self.cache_root = self.data_root = root
self.init_profile(profile) self.init_profile(profile)
if len(profile) > 0 and profile_separation: if len(profile) > 0 and profile_separation:
profile = u'.' + profile profile = u'.' + profile
else: else:
profile = '' profile = ''
d = {'LOG_DB': 'logs.db', 'MY_CACERTS': 'cacerts.pem', d = {'LOG_DB': 'logs.db', 'MY_CACERTS': 'cacerts.pem',
'MY_EMOTS': 'emoticons', 'MY_ICONSETS': 'iconsets', 'MY_EMOTS': 'emoticons', 'MY_ICONSETS': 'iconsets',
'MY_MOOD_ICONSETS': 'moods', 'MY_ACTIVITY_ICONSETS': 'activities', 'MY_MOOD_ICONSETS': 'moods', 'MY_ACTIVITY_ICONSETS': 'activities',
...@@ -159,12 +166,6 @@ class ConfigPaths: ...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment