Skip to content
Myr

Merge branch '2.9-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 921eb81, 5b335b7 · Browse files · 7 files+29 added−6 removed
This commit

State

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

Diff stats

7 files+29 added−6 removed

  • tests:+14 added−0 removed
  • other:+15 added−6 removed

7 files+29 added−6 removed

modified:docs/api.rst+1 added-1 removed
740 unmodified lines
741 result = Markup(result)742 return result743744Context filters work the same just that the first argument is the current745active :class:`Context` rather then the environment.745active :class:`Context` rather than the environment.746747748.. _eval-context:749
174 unmodified lines
modified:jinja2/runtime.py+3 added-1 removed
9 unmodified lines
10"""11import sys1213from itertools import chain14from types import MethodType1516from jinja2.nodes import EvalContext, _context_function_types17from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \18 internalcode, object_type_repr, evalcontextfunction19from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
148 unmodified lines
168169 # In case we detect the fast resolve mode we can set up an alias170 # here that bypasses the legacy code logic.171 if self._fast_resolve_mode:170 self.resolve_or_missing = resolve_or_missing172 self.resolve_or_missing = MethodType(resolve_or_missing, self)173174 def super(self, name, current):175 """Render a parent block."""176 try:
611 unmodified lines
modified:scripts/make-release.py+1 added-1 removed
90 unmodified lines
91 set_filename_version('setup.py', version, 'version')929394def build_and_upload():95 cmd = [sys.executable, 'setup.py', 'release', 'sdist', 'bdist_wheel', 'upload']95 cmd = [sys.executable, 'setup.py', 'sdist', 'bdist_wheel', 'upload']96 if wheel is not None:97 cmd.insert(4, 'bdist_wheel')98 Popen(cmd).wait()99
65 unmodified lines
modified:tests/test_regression.py+14 added
504 unmodified lines
505 assert t.list == [1, 2]506 assert repr(t) == "('foo', [1, 2])"507 assert str(t) == "('foo', [1, 2])"508509 def test_custom_context(self, env):510 from jinja2.runtime import Context511512 class MyContext(Context):513 pass514515 class MyEnvironment(Environment):516 context_class = MyContext517518 loader = DictLoader({'base': '{{ foobar }}',519 'test': '{% extends "base" %}'})520 env = MyEnvironment(loader=loader)521 assert env.get_template('test').render(foobar='test') == 'test'522523 def test_legacy_custom_context(self, env):524 from jinja2.runtime import Context, Undefined, missing525526 class MyContext(Context):
16 unmodified lines
modified:CHANGES+6 added
9 unmodified lines
10 derived context.11- Added an `in` test that works like the in operator. This can be used12 in combination with `reject` and `select`.1314Version 2.9.615-------------16(bugfix release, released on April 3rd 2017)1718- Fixed custom context behavior in fast resolve mode (#675)1920Version 2.9.521-------------22(bugfix release, released on January 28th 2017)23
497 unmodified lines
modified:setup.cfg-3 removed
2 unmodified lines
34[metadata]5license_file = LICENSE67[aliases]8release = egg_info -RDb ''97[tool:pytest]8norecursedirs = .* *.egg *.egg-info env* artwork docs examples venv*
modified:setup.py+4 added
38 unmodified lines
394041setup(42 name='Jinja2',43<<<<<<< HEAD44 version='2.10.dev',45=======46 version='2.9.7.dev',47>>>>>>> 2.9-maintenance48 url='http://jinja.pocoo.org/',49 license='BSD',50 author='Armin Ronacher',51 author_email='armin.ronacher@active-4.com',
32 unmodified lines