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
Provenance
- Commit
c1cd154- Tree
018ae60- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
921eb81- Parent 2
5b335b7
7 files changed+29 added−6 removed
modified:docs/api.rst+1 added-1 removed
740 unmodified lines741 result = Markup(result)742 return result743 744 Context filters work the same just that the first argument is the current745-active :class:`Context` rather then the environment.745+active :class:`Context` rather than the environment.746 747 748 .. _eval-context:749 174 unmodified linesmodified:jinja2/runtime.py+3 added-1 removed
9 unmodified lines10 """11 import sys12 13 from itertools import chain14+from types import MethodType15+16 from jinja2.nodes import EvalContext, _context_function_types17 from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \18 internalcode, object_type_repr, evalcontextfunction19 from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \148 unmodified lines168 169 # 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)173 174 def super(self, name, current):175 """Render a parent block."""176 try:611 unmodified linesmodified:scripts/make-release.py+1 added-1 removed
90 unmodified lines91 set_filename_version('setup.py', version, 'version')92 93 94 def 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 linesmodified:tests/test_regression.py+14 added
504 unmodified lines505 assert t.list == [1, 2]506 assert repr(t) == "('foo', [1, 2])"507 assert str(t) == "('foo', [1, 2])"508 509+ def test_custom_context(self, env):510+ from jinja2.runtime import Context511+512+ class MyContext(Context):513+ pass514+515+ class MyEnvironment(Environment):516+ context_class = MyContext517+518+ loader = DictLoader({'base': '{{ foobar }}',519+ 'test': '{% extends "base" %}'})520+ env = MyEnvironment(loader=loader)521+ assert env.get_template('test').render(foobar='test') == 'test'522+523 def test_legacy_custom_context(self, env):524 from jinja2.runtime import Context, Undefined, missing525 526 class MyContext(Context):16 unmodified linesmodified:CHANGES+6 added
9 unmodified lines10 derived context.11 - Added an `in` test that works like the in operator. This can be used12 in combination with `reject` and `select`.13 14+Version 2.9.615+-------------16+(bugfix release, released on April 3rd 2017)17+18+- Fixed custom context behavior in fast resolve mode (#675)19+20 Version 2.9.521 -------------22 (bugfix release, released on January 28th 2017)23 497 unmodified linesmodified:setup.cfg-3 removed
2 unmodified lines3 4 [metadata]5 license_file = LICENSE6 7-[aliases]8-release = egg_info -RDb ''9-7 [tool:pytest]8 norecursedirs = .* *.egg *.egg-info env* artwork docs examples venv*modified:setup.py+4 added
38 unmodified lines39 40 41 setup(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