Skip to content
Myr

Merge remote-tracking branch 'ThomasWaldmann/sprint-branch' into sprint-branch

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents 4cd6e9a, 05ace8b · Browse files · 4 files+30 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+30 added−11 removed

  • other:+30 added−11 removed

4 files+30 added−11 removed

modified:jinja2/_markupsafe/__init__.py+1 added-4 removed
9 unmodified lines
10"""11import re12import six13from six.moves import map14try:15 unichr = unichr # py216except NameError:17 unichr = chr # py314from jinja2._compat import unichr1516__all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent']1718
200 unmodified lines
added:jinja2/_compat.py+24 added
1# -*- coding: utf-8 -*-2"""3 jinja2._compat4 ~~~~~~~~~~~~~~56 Some py2/py3 compatibility support that is not yet available in7 "six" 1.3.0.8 There are bugs open for "six" for all this stuff, so we can remove it9 again from here as soon as we require a new enough "six" release.1011 :copyright: Copyright 2013 by the Jinja team, see AUTHORS.12 :license: BSD, see LICENSE for details.13"""1415# https://bitbucket.org/gutworth/six/issue/25/add-unichr16try:17 unichr = unichr # py218except NameError:19 unichr = chr # py32021try:22 range_type = xrange23except NameError:24 range_type = range
modified:jinja2/_stringdefs.py+2 added
11 unmodified lines
12 :copyright: Copyright 2006-2009 by the Jinja team, see AUTHORS.13 :license: BSD, see LICENSE for details.14"""1516from jinja2._compat import unichr1718Cc = u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f'1920Cf = u'\xad\u0600\u0601\u0602\u0603\u06dd\u070f\u17b4\u17b5\u200b\u200c\u200d\u200e\u200f\u202a\u202b\u202c\u202d\u202e\u2060\u2061\u2062\u2063\u206a\u206b\u206c\u206d\u206e\u206f\ufeff\ufff9\ufffa\ufffb'21
111 unmodified lines
modified:jinja2/compiler.py+3 added-7 removed
13 unmodified lines
14from jinja2.nodes import EvalContext15from jinja2.visitor import NodeVisitor16from jinja2.exceptions import TemplateAssertionError17from jinja2.utils import Markup, concat, escape, is_python_keyword18from jinaj2._compat import range_type19import six20from six.moves import cStringIO as StringIO, map2121# TODO: Move this to the compat module.22try:23 range_type = xrange24except NameError:25 range_type = range222723operators = {24 'eq': '==',25 'ne': '!=',26 'gt': '>',
39 unmodified lines
66def has_safe_repr(value):67 """Does the node have a safe representation?"""68 if value is None or value is NotImplemented or value is Ellipsis:69 return True75 if isinstance(value, (bool, int, float, complex, range_type, Markup) + six.string_types):70 if isinstance(value, (bool, int, float, complex, range_type,71 Markup) + six.string_types):72 return True73 if isinstance(value, (tuple, list, set, frozenset)):74 for item in value:75 if not has_safe_repr(item):
1563 unmodified lines