config.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:UrbanSearch 作者: urbansearchTUD 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号