def _load_config():
# Fills the global CONFIG dictionary using default and custom config
# Returns an error if the custom config is invalid
global CONFIG
try:
cfg = _load_default_config()
custom_cfg = _load_custom_config()
if custom_cfg:
CONFIG = _merge(cfg, custom_cfg)
else:
CONFIG = cfg
except yaml.YAMLError as exc:
# Try to point to the line that threw an error
if hasattr(exc, 'problem_mark'):
mark = exc.problem_mark
return 'Error in YAML at position: ({}:{})'.format(mark.line + 1,
mark.column + 1)
评论列表
文章目录