config.py 310 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 import yaml class Config(): def __init__(self, yaml_path): yaml_file = open(yaml_path) self._attr = yaml.load(yaml_file, Loader=yaml.FullLoader)['settings'] def __getattr__(self, attr): try: return self._attr[attr] except KeyError: return None