Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (32 sloc) 0.974 kb
92f572f @mitsuhiko [svn] added new jinja trunk
authored
1 # -*- coding: utf-8 -*-
2 """
c63243e @mitsuhiko added sandbox and exchageable undefined objects
authored
3 jinja2.defaults
4 ~~~~~~~~~~~~~~~
92f572f @mitsuhiko [svn] added new jinja trunk
authored
5
6 Jinja default filters and tags.
7
55494e4 @mitsuhiko It's a new year
authored
8 :copyright: (c) 2010 by the Jinja Team.
92f572f @mitsuhiko [svn] added new jinja trunk
authored
9 :license: BSD, see LICENSE for more details.
10 """
d34eb12 @mitsuhiko Implemented and documented "joiner"
authored
11 from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
c63243e @mitsuhiko added sandbox and exchageable undefined objects
authored
12
5f51488 @mitsuhiko updated a few filters and improved i18n
authored
13
4f5008f @mitsuhiko moved environment defaults to jinja2.defaults
authored
14 # defaults for the parser / lexer
7259c76 @mitsuhiko moved caching from loaders to environment and added environment overlays
authored
15 BLOCK_START_STRING = '{%'
16 BLOCK_END_STRING = '%}'
17 VARIABLE_START_STRING = '{{'
18 VARIABLE_END_STRING = '}}'
19 COMMENT_START_STRING = '{#'
20 COMMENT_END_STRING = '#}'
21 LINE_STATEMENT_PREFIX = None
59b6bd5 @mitsuhiko Added support for line-based comments.
authored
22 LINE_COMMENT_PREFIX = None
4f5008f @mitsuhiko moved environment defaults to jinja2.defaults
authored
23 TRIM_BLOCKS = False
24 NEWLINE_SEQUENCE = '\n'
7259c76 @mitsuhiko moved caching from loaders to environment and added environment overlays
authored
25
26
4f5008f @mitsuhiko moved environment defaults to jinja2.defaults
authored
27 # default filters, tests and namespace
28 from jinja2.filters import FILTERS as DEFAULT_FILTERS
29 from jinja2.tests import TESTS as DEFAULT_TESTS
e9e43bb @tux21b converted unit tests, started rewriting filters
tux21b authored
30 DEFAULT_NAMESPACE = {
1442519 @mitsuhiko Removed unnecessary runtime check. Our 2to3 fixer fixes that
authored
31 'range': xrange,
76c280b @mitsuhiko improved sandbox, added proper striptags and updated documentation to la...
authored
32 'dict': lambda **kw: kw,
ccae055 @mitsuhiko Various cleanups and added custom cycler.
authored
33 'lipsum': generate_lorem_ipsum,
d34eb12 @mitsuhiko Implemented and documented "joiner"
authored
34 'cycler': Cycler,
35 'joiner': Joiner
e9e43bb @tux21b converted unit tests, started rewriting filters
tux21b authored
36 }
7259c76 @mitsuhiko moved caching from loaders to environment and added environment overlays
authored
37
38
39 # export all constants
272ca2a @aliafshar This commit makes the parser and lexer use regular string comparison to ...
aliafshar authored
40 __all__ = tuple(x for x in locals().keys() if x.isupper())
Something went wrong with that request. Please try again.