main.py 文件源码

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

项目:skydoc 作者: bazelbuild 项目源码 文件源码
def _write_ruleset(self, output_dir, ruleset):
    # Load template and render Markdown.
    template = self.__env.get_template('markdown.jinja')
    out = template.render(ruleset=ruleset)

    # Write output to file. Output files are created in a directory structure
    # that matches that of the input file.
    output_path = ruleset.output_file + '.md'
    output_file = "%s/%s" % (output_dir, output_path)
    file_dirname = os.path.dirname(output_file)
    if not os.path.exists(file_dirname):
      os.makedirs(file_dirname)
    with open(output_file, "w") as f:
      f.write(out)
    return (output_file, output_path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号