A corporation manager and dashboard for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
524 B

  1. # -*- coding: utf-8 -*-
  2. import yaml
  3. __all__ = ["Config"]
  4. class Config:
  5. def __init__(self, confdir):
  6. self._filename = confdir / "config.yml"
  7. self._data = None
  8. self._load()
  9. def _load(self):
  10. with self._filename.open("rb") as fp:
  11. self._data = yaml.load(fp)
  12. def get(self, key="", default=None):
  13. obj = self._data
  14. for item in key.split("."):
  15. if item not in obj:
  16. return default
  17. obj = obj[item]
  18. return obj