This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/config/read.py
2017-06-09 22:33:40 +01:00

11 lines
349 B
Python

import yaml
from md_pdf.consts import CONFIG_FILE
from md_pdf.exceptions import ConfigValidationException
def load_config(location=CONFIG_FILE):
try:
with open(location) as f:
return yaml.safe_load(f)
except FileNotFoundError:
raise ConfigValidationException("Can't find config file at {}".format(CONFIG_FILE))