Corrected config_file.py
This commit is contained in:
parent
d9c18cc9d4
commit
7e4f18fe52
@ -14,7 +14,7 @@ IS_DEBUG = False
|
||||
IS_DOCS_AVAILABLE = False
|
||||
|
||||
def read_app_config():
|
||||
j, _ = read_cfg(CONFIG_FILE_NAME)
|
||||
j = read_cfg(CONFIG_FILE_NAME)
|
||||
return j
|
||||
|
||||
def get_config_value(cfg, section, key, default):
|
||||
|
||||
@ -7,11 +7,11 @@ def read_config(name):
|
||||
raise Exception(f"File {name} doesn't exists")
|
||||
filename, ext = os.path.splitext(name)
|
||||
if 'json' in ext:
|
||||
return read_json(name), os.path.getmtime(name)
|
||||
return read_json(name)
|
||||
elif 'properties' in ext:
|
||||
return read_prop(name), os.path.getmtime(name)
|
||||
return read_prop(name)
|
||||
elif 'yaml' in ext or 'yml' in ext:
|
||||
return read_yaml(name), os.path.getmtime(name)
|
||||
return read_yaml(name)
|
||||
else:
|
||||
raise Exception("Wrong file type")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user