allow reading config by dot
This commit is contained in:
parent
7173bee935
commit
5ab9211958
3 changed files with 4 additions and 2 deletions
|
@ -1,8 +1,9 @@
|
|||
import yaml
|
||||
from dotmap import DotMap
|
||||
import os
|
||||
from md_pdf.consts import CONFIG_FILE
|
||||
|
||||
|
||||
def load_config():
|
||||
with open(os.path.join(CONFIG_FILE)) as f:
|
||||
return yaml.load(f)
|
||||
return DotMap(yaml.load(f))
|
||||
|
|
|
@ -10,7 +10,7 @@ REQUIRED_KEYS = [
|
|||
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))
|
||||
raise ConfigValidationException("Missing required keys: {}".format(", ".join(missing_keys)))
|
||||
|
||||
|
||||
def validate_config(config):
|
||||
|
|
1
setup.py
1
setup.py
|
@ -6,6 +6,7 @@ setup(
|
|||
version="1.0",
|
||||
install_requires=[
|
||||
"beautifulsoup4==4.5.3",
|
||||
"dotmap==1.2.17",
|
||||
"jinja2==2.9.5",
|
||||
"pdfkit==0.6.1",
|
||||
"pypandoc==1.3.3",
|
||||
|
|
Reference in a new issue