Skip to content
Myr

Merge branch '2.7-maintenance'

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 d65f40f, 8b0c37c · Browse files · 8 files+31 added−30 removed
This commit

State

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

Diff stats

8 files+31 added−30 removed

  • other:+31 added−30 removed

8 files+31 added−30 removed

modified:jinja2/testsuite/filters.py+2 added
206 unmodified lines
207 tmpl = env.from_string('''{{ "foo-bar"|title }}''')208 assert tmpl.render() == "Foo-Bar"209 tmpl = env.from_string('''{{ "foo\tbar"|title }}''')210 assert tmpl.render() == "Foo\tBar"211 tmpl = env.from_string('''{{ "FOO\tBAR"|title }}''')212 assert tmpl.render() == "Foo\tBar"213214 class Foo:215 def __str__(self):216 return 'foo-bar'
307 unmodified lines
modified:jinja2/testsuite/imports.py-16 removed
119 unmodified lines
120 item="{{ item }}"121 )))122 assert env.get_template("main").render() == "123"123124 def test_included_block_override(self):125 env = Environment(loader=DictLoader(dict(126 main="{% extends 'base' %}{% block b %}1337{% endblock %}",127 base="{% include 'inc' %}",128 inc="{% block b %}42{% endblock %}"129 )))130 assert env.get_template("main").render() == "1337"131132 def test_included_block_override_with_super(self):133 env = Environment(loader=DictLoader(dict(134 main="{% extends 'base' %}{% block b %}1337|{{ super() }}{% endblock %}",135 base="{% include 'inc' %}",136 inc="{% block b %}42{% endblock %}"137 )))138 assert env.get_template("main").render() == "1337|42"139124 def test_unoptimized_scopes(self):125 t = test_env.from_string("""126 {% macro outer(o) %}127 {% macro inner() %}
14 unmodified lines
modified:jinja2/compiler.py+2 added-9 removed
947 unmodified lines
948 self.writeline('else:')949 self.indent()950951 if node.with_context:952 self.writeline('include_context = template.new_context('953 'context.parent, True, locals())')954 self.writeline('for name, context_blocks in context.'955 'blocks.%s():' % dict_item_iter)956 self.indent()957 self.writeline('include_context.blocks.setdefault('958 'name, [])[0:0] = context_blocks')959 self.outdent()952 self.writeline('for event in template.root_render_func('961 'include_context):')953 'template.new_context(context.parent, True, '954 'locals())):')955 else:956 self.writeline('for event in template.module._body_stream:')957958 self.indent()
682 unmodified lines
modified:jinja2/filters.py+1 added-1 removed
184 unmodified lines
185 rv = []186 for item in re.compile(r'([-\s]+)(?u)').split(soft_unicode(s)):187 if not item:188 continue189 rv.append(item[0].upper() + item[1:])189 rv.append(item[0].upper() + item[1:].lower())190 return ''.join(rv)191192193def do_dictsort(value, case_sensitive=False, by='key'):
795 unmodified lines
modified:jinja2/nodes.py+3 added
230 unmodified lines
231232 def __ne__(self, other):233 return not self.__eq__(other)234235 # Restore Python 2 hashing behavior on Python 3236 __hash__ = object.__hash__237238 def __repr__(self):239 return '%s(%s)' % (240 self.__class__.__name__,241 ', '.join('%s=%r' % (arg, getattr(self, arg, None)) for
673 unmodified lines
modified:jinja2/runtime.py+11 added-1 removed
495 unmodified lines
496 __getitem__ = __lt__ = __le__ = __gt__ = __ge__ = __int__ = \497 __float__ = __complex__ = __pow__ = __rpow__ = \498 _fail_with_undefined_error499500 def __eq__(self, other):501 return type(self) is type(other)502503 def __ne__(self, other):504 return not self.__eq__(other)505506 def __hash__(self):507 return id(type(self))508509 def __str__(self):510 return u''511512 def __len__(self):
58 unmodified lines
571 UndefinedError: 'foo' is undefined572 """573 __slots__ = ()574 __iter__ = __str__ = __len__ = __nonzero__ = __eq__ = \566 __ne__ = __bool__ = Undefined._fail_with_undefined_error575 __ne__ = __bool__ = __hash__ = \576 Undefined._fail_with_undefined_error577578579# remove remaining slots attributes, after the metaclass did the magic they580# are unneeded and irritating as they contain wrong data for the subclasses.
1 unmodified line
modified:scripts/make-release.py+4 added-2 removed
15 unmodified lines
16from datetime import datetime, date17from subprocess import Popen, PIPE181920_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)')212223def parse_changelog():24 with open('CHANGES') as f:25 lineiter = iter(f)26 for line in lineiter:
28 unmodified lines
55 return '.'.join(map(str, parts))565758def parse_date(string):56 string = string.replace('th ', ' ').replace('nd ', ' ') \57 .replace('rd ', ' ').replace('st ', ' ')59 string = _date_strip_re.sub('', string)60 return datetime.strptime(string, '%B %d %Y')616263def set_filename_version(filename, version_number, pattern):
90 unmodified lines
modified:CHANGES+8 added-1 removed
1 unmodified line
2================34Version 2.7.15-------------6(bugfix release)6(bugfix release, released on August 7th 2013)78- Fixed a bug with ``call_filter`` not working properly on environment9 and context filters.10- Fixed lack of Python 3 support for bytecode caches.11- Reverted support for defining blocks in included templates as this12 broke existing templates for users.13- Fixed some warnings with hashing of undefineds and nodes if Python14 is run with warnings for Python 3.15- Added support for properly hashing undefined objects.16- Fixed a bug with the title filter not working on already uppercase17 strings.1819Version 2.720-----------21(codename Translation, released on May 20th 2013)
294 unmodified lines