Remove ternary operator, fixes #8388

This commit is contained in:
tmolitor 2016-09-06 16:19:44 +02:00
parent 76530a429a
commit a4bda85428
1 changed files with 12 additions and 3 deletions

View File

@ -150,7 +150,10 @@ class ConfigPaths:
for name in d:
d[name] += profile
self.add(name, TYPE_DATA, windowsify(d[name]))
self.add('MY_DATA', TYPE_DATA, len(profile) ? 'data.dir' + profile : '')
if len(profile):
self.add('MY_DATA', TYPE_DATA, 'data.dir')
else:
self.add('MY_DATA', TYPE_DATA, '')
d = {'CACHE_DB': 'cache.db', 'VCARD': 'vcards',
'AVATAR': 'avatars',
@ -158,13 +161,19 @@ class ConfigPaths:
for name in d:
d[name] += profile
self.add(name, TYPE_CACHE, windowsify(d[name]))
self.add('MY_CACHE', TYPE_CACHE, len(profile) ? 'cache.dir' + profile : '')
if len(profile):
self.add('MY_CACHE', TYPE_CACHE, 'cache.dir')
else:
self.add('MY_CACHE', TYPE_CACHE, '')
d = {'CONFIG_FILE': 'config', 'PLUGINS_CONFIG_DIR': 'pluginsconfig', 'MY_CERT': 'localcerts'}
for name in d:
d[name] += profile
self.add(name, TYPE_CONFIG, windowsify(d[name]))
self.add('MY_CONFIG', TYPE_CONFIG, len(profile) ? 'config.dir' + profile : '')
if len(profile):
self.add('MY_CONFIG', TYPE_CONFIG, 'config.dir')
else:
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')))