2015-08-02 11:59:11 -07:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
jinja2
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
Jinja2 is a template engine written in pure Python. It provides a
|
|
|
|
Django inspired non-XML syntax but supports inline expressions and
|
|
|
|
an optional sandboxed environment.
|
|
|
|
|
|
|
|
Nutshell
|
|
|
|
--------
|
|
|
|
|
|
|
|
Here a small example of a Jinja2 template::
|
|
|
|
|
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% block title %}Memberlist{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<ul>
|
|
|
|
{% for user in users %}
|
|
|
|
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
:copyright: (c) 2010 by the Jinja Team.
|
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
__docformat__ = 'restructuredtext en'
|
2016-11-09 10:24:33 -08:00
|
|
|
__version__ = '2.8'
|
2015-08-02 11:59:11 -07:00
|
|
|
|
|
|
|
# high level interface
|
|
|
|
from jinja2.environment import Environment, Template
|
|
|
|
|
|
|
|
# loaders
|
|
|
|
from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
|
|
|
|
DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
|
|
|
|
ModuleLoader
|
|
|
|
|
|
|
|
# bytecode caches
|
|
|
|
from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
|
|
|
|
MemcachedBytecodeCache
|
|
|
|
|
|
|
|
# undefined types
|
2016-11-09 10:24:33 -08:00
|
|
|
from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined, \
|
|
|
|
make_logging_undefined
|
2015-08-02 11:59:11 -07:00
|
|
|
|
|
|
|
# exceptions
|
|
|
|
from jinja2.exceptions import TemplateError, UndefinedError, \
|
|
|
|
TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
|
|
|
|
TemplateAssertionError
|
|
|
|
|
|
|
|
# decorators and public utilities
|
|
|
|
from jinja2.filters import environmentfilter, contextfilter, \
|
|
|
|
evalcontextfilter
|
|
|
|
from jinja2.utils import Markup, escape, clear_caches, \
|
|
|
|
environmentfunction, evalcontextfunction, contextfunction, \
|
|
|
|
is_undefined
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',
|
|
|
|
'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',
|
|
|
|
'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',
|
|
|
|
'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',
|
|
|
|
'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',
|
|
|
|
'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',
|
|
|
|
'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',
|
|
|
|
'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',
|
2016-11-09 10:24:33 -08:00
|
|
|
'evalcontextfilter', 'evalcontextfunction', 'make_logging_undefined',
|
2015-08-02 11:59:11 -07:00
|
|
|
]
|