Fix load config

This commit is contained in:
Cédric Leporcq 2021-08-08 12:53:43 +02:00
parent 308c1eef5c
commit 38794cd41d
1 changed files with 10 additions and 7 deletions

View File

@ -4,17 +4,20 @@ from os import path
from dozo import constants from dozo import constants
def load_config(file): def write(conf_file, config):
if hasattr(load_config, "config"): with open(conf_file, 'w') as conf_file:
return load_config.config config.write(conf_file)
return True
return False
def load_config(file):
if not path.exists(file): if not path.exists(file):
return {} return {}
load_config.config = RawConfigParser() config = RawConfigParser()
load_config.config.read(file) config.read(file)
return load_config.config return config
def get_path_definition(config): def get_path_definition(config):
"""Returns a list of folder definitions. """Returns a list of folder definitions.