plugin_formatter.py 文件源码

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

项目:netscaler-ansible-modules 作者: citrix 项目源码 文件源码
def jinja2_environment(template_dir, typ):

    env = Environment(loader=FileSystemLoader(template_dir),
                      variable_start_string="@{",
                      variable_end_string="}@",
                      trim_blocks=True)
    env.globals['xline'] = rst_xline

    if typ == 'rst':
        env.filters['convert_symbols_to_format'] = rst_ify
        env.filters['html_ify'] = html_ify
        env.filters['fmt'] = rst_fmt
        env.filters['xline'] = rst_xline
        template = env.get_template('plugin.rst.j2')
        outputname = "%s_module.rst"
    else:
        raise Exception("unknown module format type: %s" % typ)

    return env, template, outputname
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号