spec.py 文件源码

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

项目:badwolf 作者: bosondata 项目源码 文件源码
def parse_file(cls, path):
        try:
            if hasattr(path, 'read') and callable(path.read):
                # File-like obj
                conf = yaml.load(path.read(), Loader=_Loader)
            else:
                with io.open(path) as f:
                    conf = yaml.load(f.read(), Loader=_Loader)
        except yaml.error.MarkedYAMLError as e:
            raise InvalidSpecification(str(e))

        return cls.parse(conf)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号