summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2009-02-24 22:58:00 +0100
committerArmin Ronacher <armin.ronacher@active-4.com>2009-02-24 22:58:00 +0100
commitd416a97260947fcd302f2e14e28cb6160dd412ab (patch)
treec673bf982daeb646465bb000d938f86bf052f2d0 /examples
parent1d021082f61dbad8ba64181b743cd29da514dfff (diff)
downloadjinja2-d416a97260947fcd302f2e14e28cb6160dd412ab.tar.gz
Improved Jinja's debugging support by introducing "@internalcode" which marks code objects that are skipped on tracebacks. Also template errors are now translated as well to help the pylons debugger.
--HG-- branch : trunk
Diffstat (limited to 'examples')
-rw-r--r--examples/basic/debugger.py2
-rw-r--r--examples/basic/templates/broken.html3
-rw-r--r--examples/basic/templates/subbroken.html3
3 files changed, 6 insertions, 2 deletions
diff --git a/examples/basic/debugger.py b/examples/basic/debugger.py
index 52a8be2..4291ff7 100644
--- a/examples/basic/debugger.py
+++ b/examples/basic/debugger.py
@@ -4,4 +4,4 @@ from jinja2.loaders import FileSystemLoader
env = Environment(loader=FileSystemLoader('templates'))
tmpl = env.get_template('broken.html')
-print tmpl.render(seq=range(10))
+print tmpl.render(seq=[3, 2, 4, 5, 3, 2, 0, 2, 1])
diff --git a/examples/basic/templates/broken.html b/examples/basic/templates/broken.html
index bbd5bf4..294d5c9 100644
--- a/examples/basic/templates/broken.html
+++ b/examples/basic/templates/broken.html
@@ -1,5 +1,6 @@
+{% from 'subbroken.html' import may_break %}
<ul>
{% for item in seq %}
- <li>{{ item / 0 }}</li>
+ <li>{{ may_break(item) }}</li>
{% endfor %}
</ul>
diff --git a/examples/basic/templates/subbroken.html b/examples/basic/templates/subbroken.html
new file mode 100644
index 0000000..245eb7e
--- /dev/null
+++ b/examples/basic/templates/subbroken.html
@@ -0,0 +1,3 @@
+{% macro may_break(item) -%}
+ [{{ item / 0 }}]
+{%- endmacro %}