Fix load config
This commit is contained in:
parent
308c1eef5c
commit
38794cd41d
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue