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

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

Issue 2316103002: binding: Updates Jinja2 from 2.7.1 to 2.8. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « third_party/jinja2/environment.py ('k') | third_party/jinja2/filters.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.ext 3 jinja2.ext
4 ~~~~~~~~~~ 4 ~~~~~~~~~~
5 5
6 Jinja extensions allow to add custom tags similar to the way django custom 6 Jinja extensions allow to add custom tags similar to the way django custom
7 tags work. By default two example extensions exist: an i18n and a cache 7 tags work. By default two example extensions exist: an i18n and a cache
8 extension. 8 extension.
9 9
10 :copyright: (c) 2010 by the Jinja Team. 10 :copyright: (c) 2010 by the Jinja Team.
11 :license: BSD. 11 :license: BSD.
12 """ 12 """
13 from jinja2 import nodes 13 from jinja2 import nodes
14 from jinja2.defaults import BLOCK_START_STRING, \ 14 from jinja2.defaults import BLOCK_START_STRING, \
15 BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \ 15 BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \
16 COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \ 16 COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \
17 LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \ 17 LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \
18 KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS 18 KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS
19 from jinja2.environment import Environment 19 from jinja2.environment import Environment
20 from jinja2.runtime import concat 20 from jinja2.runtime import concat
21 from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError 21 from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
22 from jinja2.utils import contextfunction, import_string, Markup 22 from jinja2.utils import contextfunction, import_string, Markup
23 from jinja2._compat import next, with_metaclass, string_types, iteritems 23 from jinja2._compat import with_metaclass, string_types, iteritems
24 24
25 25
26 # the only real useful gettext functions for a Jinja template. Note 26 # the only real useful gettext functions for a Jinja template. Note
27 # that ugettext must be assigned to gettext as Jinja doesn't support 27 # that ugettext must be assigned to gettext as Jinja doesn't support
28 # non unicode strings. 28 # non unicode strings.
29 GETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext') 29 GETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext')
30 30
31 31
32 class ExtensionRegistry(type): 32 class ExtensionRegistry(type):
33 """Gives the extension an unique identifier.""" 33 """Gives the extension an unique identifier."""
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 for lineno, func, message in extract_from_ast(node, keywords): 627 for lineno, func, message in extract_from_ast(node, keywords):
628 yield lineno, func, message, finder.find_comments(lineno) 628 yield lineno, func, message, finder.find_comments(lineno)
629 629
630 630
631 #: nicer import names 631 #: nicer import names
632 i18n = InternationalizationExtension 632 i18n = InternationalizationExtension
633 do = ExprStmtExtension 633 do = ExprStmtExtension
634 loopcontrols = LoopControlExtension 634 loopcontrols = LoopControlExtension
635 with_ = WithExtension 635 with_ = WithExtension
636 autoescape = AutoEscapeExtension 636 autoescape = AutoEscapeExtension
OLDNEW
« no previous file with comments | « third_party/jinja2/environment.py ('k') | third_party/jinja2/filters.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698