Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | don't prefetch next item in loop context | David Lord | 2019-11-07 | 1 | -94/+157 |
| | |||||
* | fixing LoopContext, loops indexing and iterator length property | aayushuppal | 2019-10-14 | 1 | -12/+11 |
| | |||||
* | Don't make cond_expr_undefined configurable | Adrian Moennich | 2019-10-13 | 1 | -1/+1 |
| | |||||
* | Fix bug with when using Markup on ChainableUndefined | Laurence de Bruxelles | 2019-10-04 | 1 | -4/+7 |
| | | | | | | | | | Wrapping a ChainableUndefined object with Markup causes an UndefinedError because Markup thinks that ChainableUndefined has an attribute called __html__ and tries to call it. This commit fixes this by defining a method __html__ that calls ChainableUndefined.__str__. We also add a regression test. | ||||
* | Fix simple typo: problemtic -> problematic (#1059) | Tim Gates | 2019-09-04 | 1 | -3/+2 |
| | | | Plus rephrase the comment for greater clarity. | ||||
* | Fix typo | Min ho Kim | 2019-07-25 | 1 | -1/+1 |
| | |||||
* | Apply suggestions | Min ho Kim | 2019-07-07 | 1 | -1/+1 |
| | |||||
* | Fix typo | Min ho Kim | 2019-07-07 | 1 | -1/+1 |
| | |||||
* | Fix typo "the the" | Jon Dufresne | 2019-06-21 | 1 | -1/+1 |
| | |||||
* | Add ChainableUndefined allowing getattr & getitem (#997) | Étienne Pelletier | 2019-05-08 | 1 | -3/+30 |
| | | | | | | | | | | | | | | * Add ChainableUndefined allowing getattr & getitem Allows using default values with chains of items or attributes that may contain undefined values without raising a jinja2.exceptions.UndefinedError. >>> import jinja2 >>> env = jinja2.Environment(undefined=jinja2.ChainableUndefined) >>> env.from_string("{{ foo.bar['baz'] | default('val') }}").render() 'val' * Remove class decorator from ChainableUndefined | ||||
* | Import abstract base classes from collections.abc | Florian Bruhin | 2018-08-07 | 1 | -7/+2 |
| | | | | | | | | | | | | | | | | In Python 3.7, importing ABCs directly from the `collections` module shows a warning (and in Python 3.8 it will stop working) - see https://github.com/python/cpython/commit/c66f9f8d3909f588c251957d499599a1680e2320 This fixes various DeprecationWarnings such as those: ``` .../jinja2/utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import MutableMapping .../jinja2/runtime.py:318: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Mapping ``` | ||||
* | Merge pull request #502 from berrange/callable | David Lord | 2017-07-07 | 1 | -7/+8 |
|\ | | | | | runtime: avoid assumption that all objects provide __call__ | ||||
| * | runtime: avoid assumption that all objects provide __call__ | Daniel P. Berrange | 2015-10-13 | 1 | -7/+8 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Objects which are backed by native extensions do not provide a __call__ attribute, but are none the less callable if the native extension provides a 'tp_call' implementation. The jinja2.runtime.Context.call method unconditionally access the '__call__' attribute causing an exception to be raised if the object was a native extension method. A demo of the problem can be seen using PyGObject: $ cat demo.py #!/usr/bin/python from gi.repository import Gio from jinja2 import Environment f = Gio.File.new_for_path("/some/file.txt") print f.get_uri() t = Environment().from_string("""{{f.get_uri()}}""") print t.render(f=f) Which when run results in $ ./demo.py file:///some/file.txt Traceback (most recent call last): File "./demo.py", line 10, in <module> print t.render(f=f) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception reraise(exc_type, exc_value, tb) File "<template>", line 1, in top-level template code AttributeError: 'gi.FunctionInfo' object has no attribute '__call__' After this patch it produces $ ./demo.py file:///some/file.txt file:///some/file.txt Signed-off-by: Daniel P. Berrange <berrange@redhat.com> | ||||
* | | Add support for namespace attribute assignment | Adrian Moennich | 2017-06-24 | 1 | -2/+2 |
| | | |||||
* | | Add changed() to loop context | Adrian Moennich | 2017-06-24 | 1 | -0/+8 |
| | | |||||
* | | Add previtem/nextitem to loop context | Adrian Moennich | 2017-06-24 | 1 | -5/+22 |
| | | | | | | | | related: #641 | ||||
* | | Fix custom contexts in fast resolve mode | Adrian Moennich | 2017-03-15 | 1 | -1/+3 |
| | | | | | | | | closes #675 | ||||
* | | Fixed async macro autoescape. Fixes #671 | Armin Ronacher | 2017-01-28 | 1 | -0/+4 |
| | | |||||
* | | Add support back for custom resolves on old resolve method | Armin Ronacher | 2017-01-12 | 1 | -10/+58 |
| | | |||||
* | | Fixed some string literal warnings. Fixes #646 | Armin Ronacher | 2017-01-08 | 1 | -1/+1 |
| | | |||||
* | | Support new scoping rules in scoped blocks | Armin Ronacher | 2017-01-08 | 1 | -3/+5 |
| | | |||||
* | | Add support for explicit callers | Armin Ronacher | 2017-01-08 | 1 | -1/+15 |
| | | | | | | | | | | | | | | | | | | This adds support for a never intended Jinja2 feature which however worked in limited support before due to a bug with the identifier scoping. A quick github code search indicates that developers commonly did this to set the default caller to none. This fixes #642 | ||||
* | | Bump up the copyright to 2017 | Armin Ronacher | 2017-01-07 | 1 | -1/+1 |
| | | |||||
* | | Generalize scoping. This fixes #603 | Armin Ronacher | 2017-01-07 | 1 | -2/+7 |
| | | |||||
* | | Fixed self references in macros | Armin Ronacher | 2017-01-06 | 1 | -1/+3 |
| | | |||||
* | | Set macro autoescape behavior at call instead of compile time. Fixes #565 | Armin Ronacher | 2017-01-06 | 1 | -3/+35 |
| | | |||||
* | | Do not emit make_logging_undefined to runtime | Armin Ronacher | 2017-01-05 | 1 | -1/+1 |
| | | |||||
* | | Changed behavior of macro defaults to be frame bound | Armin Ronacher | 2017-01-03 | 1 | -7/+2 |
| | | |||||
* | | First pass on integrating id tracking | Armin Ronacher | 2017-01-03 | 1 | -6/+13 |
| | | |||||
* | | Changelog and __rsub__ handling | Armin Ronacher | 2017-01-03 | 1 | -1/+1 |
| | | |||||
* | | Merge pull request #530 from nick-garcia/master | Armin Ronacher | 2017-01-03 | 1 | -1/+1 |
|\ \ | | | | | | | Subtraction from Undefined does not raise UndefinedError | ||||
| * | | Setting __sub__ equal to _fail_with_undefined_error so subtractions with | Nick Garcia | 2016-01-07 | 1 | -1/+1 |
| |/ | | | | | | | undefined variables will fail properly like other arithemtic operations. | ||||
* | | Support the same set of loop functions for async mode | Armin Ronacher | 2016-12-28 | 1 | -24/+24 |
| | | |||||
* | | Added support for async loop context | Armin Ronacher | 2016-12-28 | 1 | -12/+21 |
|/ | |||||
* | Let the Environment override the Context | ThiefMaster | 2015-04-06 | 1 | -1/+2 |
| | | | | closes #404 | ||||
* | Fix doctests | Markus Unterwaditzer | 2015-03-22 | 1 | -7/+7 |
| | | | | Fix #427 | ||||
* | Fixed a Python 3 regression. | Armin Ronacher | 2014-06-06 | 1 | -10/+16 |
| | |||||
* | Added tests for logging undefined and added it to the docs. | Armin Ronacher | 2014-06-06 | 1 | -18/+61 |
| | |||||
* | Added support for logging of undefined objects. | Armin Ronacher | 2014-06-06 | 1 | -6/+41 |
| | | | | | | fixup! fixup! | ||||
* | Fix loop context length calculation for iterators. Fixes #244 | Christoph Reiter | 2014-03-30 | 1 | -2/+3 |
| | | | | | This resulted in wrong values for revindex and revindex0 while looping over an iterator. | ||||
* | Merge branch '2.7-maintenance' | Armin Ronacher | 2013-08-07 | 1 | -1/+11 |
|\ | |||||
| * | Fixed warnings if Python is run with -3. | Armin Ronacher | 2013-08-07 | 1 | -1/+11 |
| | | | | | | | | | | | | | | This also adds proper hashing and comparision support to undefined objects. This fixes #224 | ||||
* | | Since we no longer support 2.5 we can use the builtin next() function | Armin Ronacher | 2013-05-20 | 1 | -1/+1 |
|/ | |||||
* | Documented loop.depth and added loop.depth0. | Armin Ronacher | 2013-05-20 | 1 | -2/+4 |
| | |||||
* | feature to version check for context dict methods | Armin Ronacher | 2013-05-20 | 1 | -2/+2 |
| | |||||
* | Removed an unnecessary check | Armin Ronacher | 2013-05-20 | 1 | -8/+7 |
| | |||||
* | Make the runtime leak less of the version hacks | Armin Ronacher | 2013-05-20 | 1 | -13/+13 |
| | |||||
* | Added unicode mixin for unified string logic | Armin Ronacher | 2013-05-19 | 1 | -17/+3 |
| | |||||
* | PY3 -> PY2 macro | Armin Ronacher | 2013-05-19 | 1 | -7/+7 |
| | |||||
* | Moved all six usages (ignoring testsuite) into jinja2._compat | Armin Ronacher | 2013-05-19 | 1 | -19/+24 |
| |