Philipp Hörist pushed to branch master at gajim / gajim
Commits: 3ad539cb by Philipp Hörist at 2018-04-22T02:30:08+02:00 Make sure all config dirs get created
LOG_DB_FOLDER and CACHE_DB_FOLDER are equal to MY_DATA and MY_CACHE
- - - - -
2 changed files:
- gajim/common/check_paths.py - gajim/common/configpaths.py
Changes:
===================================== gajim/common/check_paths.py ===================================== --- a/gajim/common/check_paths.py +++ b/gajim/common/check_paths.py @@ -178,11 +178,8 @@ def split_db(): logger.CACHE_DB_PATH = tmp
def check_and_possibly_create_paths(): - LOG_DB_PATH = logger.LOG_DB_PATH - LOG_DB_FOLDER, LOG_DB_FILE = os.path.split(LOG_DB_PATH) - - CACHE_DB_PATH = logger.CACHE_DB_PATH - CACHE_DB_FOLDER, CACHE_DB_FILE = os.path.split(CACHE_DB_PATH) + LOG_DB_PATH = configpaths.get('LOG_DB') + CACHE_DB_PATH = configpaths.get('CACHE_DB')
for path in configpaths.get_paths(PathType.FOLDER): if not os.path.exists(path): @@ -192,20 +189,6 @@ def check_and_possibly_create_paths(): print(_('Gajim will now exit')) sys.exit()
- if not os.path.exists(LOG_DB_FOLDER): - create_path(LOG_DB_FOLDER) - elif os.path.isfile(LOG_DB_FOLDER): - print(_('%s is a file but it should be a directory') % LOG_DB_FOLDER) - print(_('Gajim will now exit')) - sys.exit() - - if not os.path.exists(CACHE_DB_FOLDER): - create_path(CACHE_DB_FOLDER) - elif os.path.isfile(CACHE_DB_FOLDER): - print(_('%s is a file but it should be a directory') % CACHE_DB_FOLDER) - print(_('Gajim will now exit')) - sys.exit() - if not os.path.exists(LOG_DB_PATH): if os.path.exists(CACHE_DB_PATH): os.remove(CACHE_DB_PATH)
===================================== gajim/common/configpaths.py ===================================== --- a/gajim/common/configpaths.py +++ b/gajim/common/configpaths.py @@ -124,7 +124,7 @@ class ConfigPaths: return path
def _add(self, name, path, location=None, path_type=None, unique=False): - if location is not None: + if path and location is not None: path = self._prepare(path, unique) self._paths[name] = (location, path, path_type)
@@ -135,9 +135,9 @@ class ConfigPaths:
user_dir_paths = [ ('TMP', tempfile.gettempdir()), - ('MY_CONFIG', self.config_root), - ('MY_CACHE', self.cache_root), - ('MY_DATA', self.data_root), + ('MY_CONFIG', '', PathLocation.CONFIG, PathType.FOLDER), + ('MY_CACHE', '', PathLocation.CACHE, PathType.FOLDER), + ('MY_DATA', '', PathLocation.DATA, PathType.FOLDER), ]
for path in user_dir_paths:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3ad539cbf266d1515df2e5e066d206e521b...
--- View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3ad539cbf266d1515df2e5e066d206e521b... You're receiving this email because of your account on dev.gajim.org.