test.py
This file
Path
examples/basic/test.py
27 lines · 612 bytes · Python
Last changed by
change py2 print statements to py3Kartheek Lenkalabefore adoption29b08c8
History of this fileTake it
The walk stopped after 200 commits: lines older than 8db4791 point at it.
Merge branch '2.7-maintenance'Armin Ronacherbefore adoption8db4791
lines 1–26why, one step back1from jinja2 import Environment2from jinja2.loaders import DictLoader34env = Environment(loader=DictLoader({5'child.html': u'''\6{% extends master_layout or 'master.html' %}7{% include helpers = 'helpers.html' %}8{% macro get_the_answer() %}42{% endmacro %}9{% title = 'Hello World' %}10{% block body %}11 {{ get_the_answer() }}12 {{ helpers.conspirate() }}13{% endblock %}14''',15'master.html': u'''\16<!doctype html>17<title>{{ title }}</title>18{% block body %}{% endblock %}19''',20'helpers.html': u'''\21{% macro conspirate() %}23{% endmacro %}22'''23}))242526tmpl = env.get_template("child.html")change py2 print statements to py3Kartheek Lenkalabefore adoption29b08c8
line 27why, one step back27print(tmpl.render())