sort now also accepts an attribute
[jinja2.git] / jinja2 / __init__.py
1 # -*- coding: utf-8 -*-
2 """
3     jinja2
4     ~~~~~~
5
6     Jinja2 is a template engine written in pure Python.  It provides a
7     Django inspired non-XML syntax but supports inline expressions and
8     an optional sandboxed environment.
9
10     Nutshell
11     --------
12
13     Here a small example of a Jinja2 template::
14
15         {% extends 'base.html' %}
16         {% block title %}Memberlist{% endblock %}
17         {% block content %}
18           <ul>
19           {% for user in users %}
20             <li><a href="{{ user.url }}">{{ user.username }}</a></li>
21           {% endfor %}
22           </ul>
23         {% endblock %}
24
25
26     :copyright: (c) 2010 by the Jinja Team.
27     :license: BSD, see LICENSE for more details.
28 """
29 __docformat__ = 'restructuredtext en'
30 try:
31     __version__ = __import__('pkg_resources') \
32         .get_distribution('Jinja2').version
33 except Exception:
34     __version__ = 'unknown'
35
36 # high level interface
37 from jinja2.environment import Environment, Template
38
39 # loaders
40 from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
41      DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
42      ModuleLoader
43
44 # bytecode caches
45 from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
46      MemcachedBytecodeCache
47
48 # undefined types
49 from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
50
51 # exceptions
52 from jinja2.exceptions import TemplateError, UndefinedError, \
53      TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
54      TemplateAssertionError
55
56 # decorators and public utilities
57 from jinja2.filters import environmentfilter, contextfilter, \
58      evalcontextfilter
59 from jinja2.utils import Markup, escape, clear_caches, \
60      environmentfunction, evalcontextfunction, contextfunction, \
61      is_undefined
62
63 __all__ = [
64     'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',
65     'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',
66     'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',
67     'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',
68     'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',
69     'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',
70     'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',
71     'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',
72     'evalcontextfilter', 'evalcontextfunction'
73 ]