File: super.py

package info (click to toggle)
jinja 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,408 kB
  • ctags: 1,171
  • sloc: python: 6,438; ansic: 397; makefile: 74
file content (12 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
# test file for block super support
import jdebug
from jinja import Environment, DictLoader

env = Environment(loader=DictLoader({
    'a': '{% block intro %}INTRO{% endblock %}|BEFORE|{% block data %}INNER{% endblock %}|AFTER',
    'b': '{% extends "a" %}{% block data %}({{ super() }}){% endblock %}',
    'c': '{% extends "b" %}{% block intro %}--{{ super() }}--{% endblock %}\n{% block data %}[{{ super() }}]{% endblock %}'
}))

tmpl = env.get_template('c')
print tmpl.render()