Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: third_party/jinja2/defaults.py

Issue 23506004: Update Jinja2 (Python template library) to 2.7.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/jinja2/debug.py ('k') | third_party/jinja2/environment.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 """ 2 """
3 jinja2.defaults 3 jinja2.defaults
4 ~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~
5 5
6 Jinja default filters and tags. 6 Jinja default filters and tags.
7 7
8 :copyright: (c) 2010 by the Jinja Team. 8 :copyright: (c) 2010 by the Jinja Team.
9 :license: BSD, see LICENSE for more details. 9 :license: BSD, see LICENSE for more details.
10 """ 10 """
11 from jinja2._compat import range_type
11 from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner 12 from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
12 13
13 14
14 # defaults for the parser / lexer 15 # defaults for the parser / lexer
15 BLOCK_START_STRING = '{%' 16 BLOCK_START_STRING = '{%'
16 BLOCK_END_STRING = '%}' 17 BLOCK_END_STRING = '%}'
17 VARIABLE_START_STRING = '{{' 18 VARIABLE_START_STRING = '{{'
18 VARIABLE_END_STRING = '}}' 19 VARIABLE_END_STRING = '}}'
19 COMMENT_START_STRING = '{#' 20 COMMENT_START_STRING = '{#'
20 COMMENT_END_STRING = '#}' 21 COMMENT_END_STRING = '#}'
21 LINE_STATEMENT_PREFIX = None 22 LINE_STATEMENT_PREFIX = None
22 LINE_COMMENT_PREFIX = None 23 LINE_COMMENT_PREFIX = None
23 TRIM_BLOCKS = False 24 TRIM_BLOCKS = False
25 LSTRIP_BLOCKS = False
24 NEWLINE_SEQUENCE = '\n' 26 NEWLINE_SEQUENCE = '\n'
27 KEEP_TRAILING_NEWLINE = False
25 28
26 29
27 # default filters, tests and namespace 30 # default filters, tests and namespace
28 from jinja2.filters import FILTERS as DEFAULT_FILTERS 31 from jinja2.filters import FILTERS as DEFAULT_FILTERS
29 from jinja2.tests import TESTS as DEFAULT_TESTS 32 from jinja2.tests import TESTS as DEFAULT_TESTS
30 DEFAULT_NAMESPACE = { 33 DEFAULT_NAMESPACE = {
31 'range': xrange, 34 'range': range_type,
32 'dict': lambda **kw: kw, 35 'dict': lambda **kw: kw,
33 'lipsum': generate_lorem_ipsum, 36 'lipsum': generate_lorem_ipsum,
34 'cycler': Cycler, 37 'cycler': Cycler,
35 'joiner': Joiner 38 'joiner': Joiner
36 } 39 }
37 40
38 41
39 # export all constants 42 # export all constants
40 __all__ = tuple(x for x in locals().keys() if x.isupper()) 43 __all__ = tuple(x for x in locals().keys() if x.isupper())
OLDNEW
« no previous file with comments | « third_party/jinja2/debug.py ('k') | third_party/jinja2/environment.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698