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/validate.py
2017-03-29 18:43:35 +01:00

19 lines
386 B
Python

from md_pdf.exceptions import ConfigValidationException
REQUIRED_KEYS = [
'output',
'input'
]
def check_required_keys(config):
missing_keys = [key for key in REQUIRED_KEYS if key not in config]
if missing_keys:
raise ConfigValidationException("Missing required keys: {}".format(missing_keys))
def validate_config(config):
check_required_keys(config)