config.py 292 B

1234567891011121314
  1. from yaml import load
  2. try:
  3. from yaml import CLoader as Loader
  4. except ImportError:
  5. from yaml import Loader
  6. class Config:
  7. def __init__(self, data):
  8. self.__dict__.update(**data)
  9. with open('config.yml') as f:
  10. config = load(f, Loader=Loader)
  11. config = Config(config)