API Reference for Enthought Tool Suite 3.2.0

This is a simple template engine. It supports a limited number of control structures, as well as simple python expressions referencing variables in the template context.

Usage:

>>> t = Template(template_code)
>>> context = { 'spam' : 1, 'eggs' : 2 }
>>> text = t.render(context)

Template tags:

{{ EXPR }}

Evaluate EXPR against the template context and insert the result in the output.

{% assign VAR=EXPR %}

Assign the name VAR in the current context to the value of EXPR.

{% block NAME %}{% endblock %}

Everything enclosed in a block may be overridden by an extending template.

{% extends "base_template" %}

Render "base_template", but replace all blocks that are overridden in this template

{% for VAR1[,VAR2[,VAR3]] in LIST_EXPR %}{% endfor %}

A for loop, just as in Python.

{% if TEST %} [{% else %}] {% endif %}

Evaluate test and execute the appropriate block.

{% include TEMPLATE [PARAM1=EXPR1 [PARAM2=EXPR2]] %}

Evaluate the specified template against the current context (with specified additional parameters), and insert the resulting text in the output.

Variables

Classes

Function summary

Functions

Imported Names

Local nameRefers to
format_exceptiontraceback.format_exception
format_stacktraceback.format_stack
rere
syssys

© Copyright 2002-2009 Enthought, Inc.