deploy.py 文件源码

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

项目:yoke 作者: rackerlabs 项目源码 文件源码
def write_template(self, output, filename=None):
        if not filename:
            filename = 'swagger.yml'
        swagger_file = os.path.join(self.project_dir, filename)
        _, ext = os.path.splitext(filename)
        with open(swagger_file, 'w') as fh:
            # Could be `.yaml` or `.yml` :/
            if '.y' in ext:
                fh.write(yaml.round_trip_dump(output))
            elif '.json' in ext:
                fh.write(json.dumps(output))
        return swagger_file
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号