config.py 文件源码

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

项目:yui 作者: item4 项目源码 文件源码
def load(path: pathlib.Path) -> Config:
    """Load configuration from given path."""

    if not path.exists():
        error('File do not exists.')

    if not path.is_file():
        error('Given path is not file.')

    if not path.match('*.config.toml'):
        error('File suffix must be *.config.toml')

    config = Config(copy.deepcopy(DEFAULT))
    config.update(toml.load(path.open()))

    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号