Skip to content

Commit

Permalink
config data is now made available immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
shitwolfymakes committed Jun 3, 2022
1 parent 7bfcade commit 4a6f263
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions arm/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
import os
import yaml

abcde_config_path = os.path.join("/etc/arm/config", ".abcde.yaml")
abcde_config_path = os.path.join("/etc/arm/config", ".abcde.conf")
apprise_config_path = os.path.join("/etc/arm/config", "apprise.yaml")
arm_config_path = os.path.join("/etc/arm/config", "arm.yaml")

with open(arm_config_path, "r") as f:
try:
arm_config = yaml.load(f, Loader=yaml.FullLoader)
except Exception:
arm_config = yaml.safe_load(f) # For older versions use this

def _load_config(fp):
with open(fp, "r") as yaml_file:
config = yaml.safe_load(yaml_file)
return config


apprise_config = _load_config(apprise_config_path)
arm_config = _load_config(arm_config_path)

0 comments on commit 4a6f263

Please sign in to comment.