Move config.yaml to the root folder of ED

This commit is contained in:
cmdr2
2023-06-30 16:36:24 +05:30
parent 5a643c383b
commit d023fd07b0
2 changed files with 14 additions and 3 deletions

View File

@ -102,7 +102,13 @@ def init():
def getConfig(default_val=APP_CONFIG_DEFAULTS):
config_yaml_path = os.path.join(CONFIG_DIR, "config.yaml")
config_yaml_path = os.path.join(CONFIG_DIR, "..", "config.yaml")
# migrate the old config yaml location
config_legacy_yaml = os.path.join(CONFIG_DIR, "config.yaml")
if os.path.isfile(config_legacy_yaml):
shutil.move(config_legacy_yaml, config_yaml_path)
if os.path.isfile(config_yaml_path):
try:
yaml = YAML()
@ -143,7 +149,7 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
def setConfig(config):
try: # config.yaml
config_yaml_path = os.path.join(CONFIG_DIR, "config.yaml")
config_yaml_path = os.path.join(CONFIG_DIR, "..", "config.yaml")
yaml = YAML()
if not hasattr(config, "_yaml_comment"):