def render ( template = None , ostr = None , * * kwargs ) : jinja_environment . filters [ 'texscape' ] = tex_escape template = template or DEFAULT_TEMPLATE ostr = ostr or sys . stdout jinja_template = jinja_environment . get_template ( template ) jinja_template . stream ( * * kwargs ) . dump ( ostr )
python generate html report jinja
Generate report from a campaign
def render(template=None, ostr=None, **kwargs):
    """Generate report from a campaign

    :param template: Jinja template to use, ``DEFAULT_TEMPLATE`` is used
    if not specified
    :param ostr: output file or filename. Default is standard output
    """
    jinja_environment.filters['texscape'] = tex_escape
    template = template or DEFAULT_TEMPLATE
    ostr = ostr or sys.stdout
    jinja_template = jinja_environment.get_template(template)
    jinja_template.stream(**kwargs).dump(ostr)