]> git.ipfire.org Git - thirdparty/jinja.git/log
thirdparty/jinja.git
5 years agohandle Undefined in get/select_template 1114/head
David Lord [Thu, 5 Dec 2019 21:46:36 +0000 (13:46 -0800)] 
handle Undefined in get/select_template

5 years agoMerge pull request #1113 from pallets/namespace-loader
David Lord [Thu, 5 Dec 2019 15:25:11 +0000 (07:25 -0800)] 
Merge pull request #1113 from pallets/namespace-loader

PackageLoader understands namespace packages

5 years agoPackageLoader understands namespace packages 1113/head
David Lord [Thu, 5 Dec 2019 15:05:45 +0000 (07:05 -0800)] 
PackageLoader understands namespace packages

5 years agoMerge pull request #1112 from pallets/include-syntax-error-source
David Lord [Tue, 3 Dec 2019 21:25:57 +0000 (13:25 -0800)] 
Merge pull request #1112 from pallets/include-syntax-error-source

TemplateSyntaxError from included template has source

5 years agoTemplateSyntaxError from included template has source 1112/head
David Lord [Tue, 3 Dec 2019 20:54:56 +0000 (12:54 -0800)] 
TemplateSyntaxError from included template has source

5 years agoMerge pull request #1111 from pallets/optimizer-nodes
David Lord [Tue, 3 Dec 2019 17:13:39 +0000 (09:13 -0800)] 
Merge pull request #1111 from pallets/optimizer-nodes

apply optimizer to all Expr nodes

5 years agoapply optimizer to all Expr nodes 1111/head
David Lord [Tue, 3 Dec 2019 16:57:41 +0000 (08:57 -0800)] 
apply optimizer to all Expr nodes

5 years agoMerge pull request #861 from OddBloke/contextreference_locals
David Lord [Mon, 2 Dec 2019 22:07:08 +0000 (14:07 -0800)] 
Merge pull request #861 from OddBloke/contextreference_locals

Add a DerivedContextReference node type

5 years agoadd a node for derived context references 861/head
Daniel Watkins [Fri, 1 Jun 2018 21:16:29 +0000 (17:16 -0400)] 
add a node for derived context references

This allows extensions to access locals in the scope from which they
were called.

5 years agoMerge pull request #1110 from pallets/patch-traceback
David Lord [Mon, 2 Dec 2019 21:07:56 +0000 (13:07 -0800)] 
Merge pull request #1110 from pallets/patch-traceback

rewrite traceback rewriting support

5 years agorewrite traceback rewriting support 1110/head
David Lord [Mon, 2 Dec 2019 20:58:18 +0000 (12:58 -0800)] 
rewrite traceback rewriting support

Simplify the `jinja.debug` code.

On Python >= 3.7, `tb_next` is directly assignable. On PyPy, use
transparent proxies only if support is enabled. For cpython < 3.7, use
ctypes to set `tb_next`. Rewrite the ctypes code to use `py_object` and
`pythonapi.Py_IncRef`, which seems to avoid crashing on debug builds.

On Python 3, a rewritten `TemplateSyntaxError` would retain the frames
from the compiler functions for some reason. Clear these so the template
source is the last thing in the traceback.

5 years agoMerge pull request #1109 from pallets/visit-output-refactor
David Lord [Wed, 20 Nov 2019 22:44:22 +0000 (14:44 -0800)] 
Merge pull request #1109 from pallets/visit-output-refactor

refactor visit_Output

5 years agorefactor visit_Output 1109/head
David Lord [Wed, 20 Nov 2019 20:38:16 +0000 (12:38 -0800)] 
refactor visit_Output

* `finalize` is generated once and cached for all nodes.
* Extract common behavior for native env.

Removed the compiler behavior where groups of nodes would generate a
format string. Instead, individual nodes are always yielded. This made
rendering 30% faster in the examples, and simplifies the code. It also
removes the issue where Python would report either the first or last
line of the multi-line format expression, messing up the traceback line
number mapping.

5 years agoMerge pull request #1105 from areebbeigh/issue-1102
David Lord [Wed, 20 Nov 2019 14:58:20 +0000 (06:58 -0800)] 
Merge pull request #1105 from areebbeigh/issue-1102

nodes.py: Return on first false in Compare() expr

5 years agoadd test and changelog for constant comparison folding 1105/head
David Lord [Wed, 20 Nov 2019 14:55:16 +0000 (06:55 -0800)] 
add test and changelog for constant comparison folding

5 years agoreturn on first false when folding Compare node
areebbeigh [Fri, 15 Nov 2019 16:58:55 +0000 (22:28 +0530)] 
return on first false when folding Compare node

5 years agoMerge pull request #1108 from captainmalloc/runtime_calls
David Lord [Wed, 20 Nov 2019 14:22:40 +0000 (06:22 -0800)] 
Merge pull request #1108 from captainmalloc/runtime_calls

Use 'callable' instead of typechecking for runtime calls ctx/env injection

5 years agouse 'callable' instead of typechecking to inject context 1108/head
Adriano Scoditti [Tue, 19 Nov 2019 14:26:39 +0000 (15:26 +0100)] 
use 'callable' instead of typechecking to inject context

5 years agoMerge pull request #1101 from pallets/refactor-loop-context
David Lord [Fri, 8 Nov 2019 15:13:53 +0000 (07:13 -0800)] 
Merge pull request #1101 from pallets/refactor-loop-context

don't prefetch next item in loop context

5 years agoasync templates await attribute access 1101/head
David Lord [Fri, 8 Nov 2019 02:57:21 +0000 (18:57 -0800)] 
async templates await attribute access

5 years agodon't prefetch next item in loop context
David Lord [Thu, 7 Nov 2019 21:35:57 +0000 (13:35 -0800)] 
don't prefetch next item in loop context

5 years agoMerge pull request #1098 from pallets/urlencode-docs
David Lord [Mon, 4 Nov 2019 16:50:13 +0000 (08:50 -0800)] 
Merge pull request #1098 from pallets/urlencode-docs

clarify quoting behavior of urlencode filter

5 years agoclarify quoting behavior of urlencode filter 1098/head
David Lord [Mon, 4 Nov 2019 16:04:24 +0000 (08:04 -0800)] 
clarify quoting behavior of urlencode filter

5 years agoMerge pull request #829 from aogier/feature/550-hyphens-wordwrap
David Lord [Fri, 1 Nov 2019 15:40:50 +0000 (08:40 -0700)] 
Merge pull request #829 from aogier/feature/550-hyphens-wordwrap

Exposing Textwrapper break_on_hyphens option to wordwrap filter

5 years agoadd break_on_hyphens parameter to wordwrap filter 829/head
Alessandro -oggei- Ogier [Fri, 23 Mar 2018 16:58:15 +0000 (17:58 +0100)] 
add break_on_hyphens parameter to wordwrap filter

5 years agoMerge pull request #766 from fheinle/palletes_jinja_175-wordwrap
David Lord [Fri, 1 Nov 2019 15:11:55 +0000 (08:11 -0700)] 
Merge pull request #766 from fheinle/palletes_jinja_175-wordwrap

Let wordwrap filter respect existing newlines

5 years agoreformat, doc, and test for wordwrap 766/head
David Lord [Fri, 1 Nov 2019 14:55:51 +0000 (07:55 -0700)] 
reformat, doc, and test for wordwrap

5 years agolet wordwrap filter respect existing newlines
Florian Heinle [Thu, 7 Sep 2017 09:21:11 +0000 (11:21 +0200)] 
let wordwrap filter respect existing newlines

textwrap.wrap() has unexpected behaviour where when wrapping multiple
paragraphs it will not consider existing newlines.

I.e. when your first paragraph ends on col 75, the next paragraph
will be wrapped on col 5 already.

This patch is wrapping each line individually and combining it back
together.

5 years agoMerge pull request #673 from MrSenko/get_corresponding_lineno_traceback
David Lord [Fri, 1 Nov 2019 13:22:27 +0000 (06:22 -0700)] 
Merge pull request #673 from MrSenko/get_corresponding_lineno_traceback

handle template.get_corresponding_lineno() for lines without debug info

5 years agoMerge pull request #1096 from pallets/compile-encoding
David Lord [Mon, 28 Oct 2019 16:45:30 +0000 (09:45 -0700)] 
Merge pull request #1096 from pallets/compile-encoding

compile writes utf8

5 years agocompile writes utf8 1096/head
David Lord [Mon, 28 Oct 2019 16:39:37 +0000 (09:39 -0700)] 
compile writes utf8

5 years agoMerge pull request #1095 from pallets/native-template-env
David Lord [Mon, 28 Oct 2019 16:06:00 +0000 (09:06 -0700)] 
Merge pull request #1095 from pallets/native-template-env

creating a NativeTemplate creates a NativeEnvironment

5 years agocreating a NativeTemplate creates a NativeEnvironment 1095/head
David Lord [Mon, 28 Oct 2019 16:00:01 +0000 (09:00 -0700)] 
creating a NativeTemplate creates a NativeEnvironment

5 years agoMerge pull request #1093 from cclauss/print-function
David Lord [Mon, 28 Oct 2019 13:50:55 +0000 (06:50 -0700)] 
Merge pull request #1093 from cclauss/print-function

Use print() function in both Python2 and Python 3

5 years agoUse print() function in both Python2 and Python 3 1093/head
cclauss [Sun, 27 Oct 2019 12:05:59 +0000 (13:05 +0100)] 
Use print() function in both Python2 and Python 3

5 years agoMerge pull request #1090 from pallets/lrucache-copy
David Lord [Thu, 24 Oct 2019 15:00:39 +0000 (08:00 -0700)] 
Merge pull request #1090 from pallets/lrucache-copy

LRUCache.copy's queue methods point to the correct queue

5 years agodon't create a third queue 1090/head
David Lord [Thu, 24 Oct 2019 14:54:38 +0000 (07:54 -0700)] 
don't create a third queue

5 years agoLRUCache.copy initializes queue methods
Ryan Siemens [Mon, 23 Apr 2018 07:26:22 +0000 (00:26 -0700)] 
LRUCache.copy initializes queue methods

5 years agouse "Jinja" instead of "Jinja2"
David Lord [Wed, 23 Oct 2019 20:35:49 +0000 (13:35 -0700)] 
use "Jinja" instead of "Jinja2"

5 years agoMerge pull request #1087 from pallets/jinja-name
David Lord [Wed, 23 Oct 2019 19:40:55 +0000 (12:40 -0700)] 
Merge pull request #1087 from pallets/jinja-name

use "Jinja" instead of "Jinja2"

5 years agouse "Jinja" instead of "Jinja2" 1087/head
David Lord [Wed, 23 Oct 2019 19:29:46 +0000 (12:29 -0700)] 
use "Jinja" instead of "Jinja2"

5 years agoMerge pull request #1086 from pallets/native-string-literal
David Lord [Tue, 22 Oct 2019 20:33:24 +0000 (13:33 -0700)] 
Merge pull request #1086 from pallets/native-string-literal

preserve quotes between nodes in native env

5 years agopreserve quotes between nodes in native env 1086/head
David Lord [Tue, 22 Oct 2019 19:52:59 +0000 (12:52 -0700)] 
preserve quotes between nodes in native env

5 years agoMerge pull request #1064 from alexwlchan/support-pathlib
David Lord [Mon, 21 Oct 2019 14:41:01 +0000 (07:41 -0700)] 
Merge pull request #1064 from alexwlchan/support-pathlib

Support paths created with pathlib in FileSystemLoader and ModuleLoader

5 years agouse fspath instead of str 1064/head
David Lord [Mon, 21 Oct 2019 14:00:25 +0000 (07:00 -0700)] 
use fspath instead of str

5 years agosupport pathlib in FileSystemLoader and ModuleLoader
Alex Chan [Sun, 22 Sep 2019 07:56:46 +0000 (08:56 +0100)] 
support pathlib in FileSystemLoader and ModuleLoader

5 years agoMerge pull request #1085 from pallets/docs-cycler
David Lord [Sun, 20 Oct 2019 23:50:28 +0000 (16:50 -0700)] 
Merge pull request #1085 from pallets/docs-cycler

clarify cycler.next() behavior

5 years agoclarify cycler.next() behavior 1085/head
David Lord [Sun, 20 Oct 2019 23:42:14 +0000 (16:42 -0700)] 
clarify cycler.next() behavior

5 years agoMerge pull request #1084 from pallets/i18n-docs
David Lord [Sat, 19 Oct 2019 15:08:56 +0000 (08:08 -0700)] 
Merge pull request #1084 from pallets/i18n-docs

clean up i18n documentation

5 years agoclean up i18n documentation 1084/head
David Lord [Sat, 19 Oct 2019 14:30:39 +0000 (07:30 -0700)] 
clean up i18n documentation

explain enabling newstyle
organize newstyle advantages
mention escaping percent signs for formatting
mention marking format parameters as safe
fix newstyle ref

5 years agoMerge pull request #1083 from pallets/docs-changes
David Lord [Fri, 18 Oct 2019 19:25:27 +0000 (12:25 -0700)] 
Merge pull request #1083 from pallets/docs-changes

Address various documentation requests

5 years agodocument equivalent generator expressions for filters 1083/head
David Lord [Fri, 18 Oct 2019 19:19:03 +0000 (12:19 -0700)] 
document equivalent generator expressions for filters
closes #1068

5 years agodocument how ContextReference relates to contextfunction
David Lord [Fri, 18 Oct 2019 19:03:02 +0000 (12:03 -0700)] 
document how ContextReference relates to contextfunction
closes #762

5 years agodocument formatting methods in format filter
David Lord [Fri, 18 Oct 2019 18:53:33 +0000 (11:53 -0700)] 
document formatting methods in format filter
closes #566

5 years agodocument lack of file extension
David Lord [Fri, 18 Oct 2019 18:37:37 +0000 (11:37 -0700)] 
document lack of file extension
closes #547

5 years agodocument behavior of block tag in if block
David Lord [Fri, 18 Oct 2019 18:31:00 +0000 (11:31 -0700)] 
document behavior of block tag in if block
closes #423

5 years agoformat expression docs
David Lord [Fri, 18 Oct 2019 18:23:59 +0000 (11:23 -0700)] 
format expression docs

5 years agoimprove docs about string methods in templates
David Lord [Fri, 18 Oct 2019 18:20:25 +0000 (11:20 -0700)] 
improve docs about string methods in templates
closes #273

5 years agoMerge pull request #1082 from pallets/pkgutil-loader
David Lord [Thu, 17 Oct 2019 18:17:24 +0000 (11:17 -0700)] 
Merge pull request #1082 from pallets/pkgutil-loader

PackageLoader doesn't depend on setuptools

5 years agoPackageLoader doesn't depend on setuptools 1082/head
David Lord [Wed, 16 Oct 2019 20:23:36 +0000 (13:23 -0700)] 
PackageLoader doesn't depend on setuptools

5 years agoMerge pull request #993 from aayushuppal/loop_fix
David Lord [Mon, 14 Oct 2019 16:16:59 +0000 (09:16 -0700)] 
Merge pull request #993 from aayushuppal/loop_fix

Fix for Loop properties revindex and revindex0 still wrong in Jinja2 2.10 #794

5 years agofixing LoopContext, loops indexing and iterator length property 993/head
aayushuppal [Mon, 6 May 2019 21:17:43 +0000 (17:17 -0400)] 
fixing LoopContext, loops indexing and iterator length property

5 years agoreformat changelog
David Lord [Mon, 14 Oct 2019 14:03:03 +0000 (07:03 -0700)] 
reformat changelog

5 years agoMerge pull request #1079 from ThiefMaster/cond-expr-undefined
David Lord [Sun, 13 Oct 2019 17:00:36 +0000 (10:00 -0700)] 
Merge pull request #1079 from ThiefMaster/cond-expr-undefined

Use separate undefined object for else-less conditional expressions

5 years agoDon't make cond_expr_undefined configurable 1079/head
Adrian Moennich [Sun, 13 Oct 2019 14:54:00 +0000 (16:54 +0200)] 
Don't make cond_expr_undefined configurable

5 years agoUse separate undefined object for CondExpr
Adrian Moennich [Sat, 12 Oct 2019 14:18:34 +0000 (16:18 +0200)] 
Use separate undefined object for CondExpr

5 years agoMerge pull request #1081 from pallets/open-if-exists
David Lord [Sun, 13 Oct 2019 13:48:54 +0000 (06:48 -0700)] 
Merge pull request #1081 from pallets/open-if-exists

skip template with same name as directory

5 years agoskip template with same name as directory 1081/head
David Lord [Sun, 13 Oct 2019 13:40:54 +0000 (06:40 -0700)] 
skip template with same name as directory

When using multiple paths with FileSystemLoader, a template with the
same name as a directory will not prevent loading a template in the
directory.

5 years agoMerge pull request #1080 from pallets/no-finalize-template-data
David Lord [Sun, 13 Oct 2019 04:34:11 +0000 (21:34 -0700)] 
Merge pull request #1080 from pallets/no-finalize-template-data

don't finalize TemplateData nodes

5 years agodon't finalize TemplateData nodes 1080/head
David Lord [Sun, 13 Oct 2019 04:04:31 +0000 (21:04 -0700)] 
don't finalize TemplateData nodes

Finalize only applies to the output of expressions (constant or not).
Add tests for context, eval, and env finalize functions.

5 years agoconsistent use of token constants
David Lord [Thu, 10 Oct 2019 15:50:20 +0000 (08:50 -0700)] 
consistent use of token constants

5 years agoMerge pull request #1077 from pallets/pytest-cleanup
David Lord [Thu, 10 Oct 2019 14:14:15 +0000 (07:14 -0700)] 
Merge pull request #1077 from pallets/pytest-cleanup

Pytest cleanup

5 years agofix invalid double extends test 1077/head
David Lord [Thu, 10 Oct 2019 13:57:04 +0000 (06:57 -0700)] 
fix invalid double extends test

5 years agoReplaced try...catch within tests with pytest.raises
Kevin Brown [Thu, 10 Oct 2019 06:15:15 +0000 (02:15 -0400)] 
Replaced try...catch within tests with pytest.raises

This still leaves one in test_debug which relies on reading out
the traceback and cannot easily be replaced by pytest.raises
like the others.

5 years agoMerge pull request #824 from dagwieers/new-type-tests
David Lord [Thu, 10 Oct 2019 03:09:42 +0000 (20:09 -0700)] 
Merge pull request #824 from dagwieers/new-type-tests

Add more strict type tests

5 years agoAdd more strict type tests 824/head
Dag Wieers [Sat, 17 Mar 2018 03:00:11 +0000 (04:00 +0100)] 
Add more strict type tests

This PR adds a few more type-related tests.

- boolean
    Testing of an object is a boolean required 2 tests.

- false
    Make this similar to testing none value

- true
    Make this similar to testing none value

- integer
    The existing 'number' test does not make a distinction between
    integer, float or even booleans

- float
    The existing 'number' test does not make a distinction between
    integer, float or even booleans

5 years agoMerge pull request #1073 from brtomas0/master
David Lord [Wed, 9 Oct 2019 23:38:54 +0000 (16:38 -0700)] 
Merge pull request #1073 from brtomas0/master

changed test_join functions to unique names

5 years agochanged test_join functions to unique names 1073/head
Brandon Tomás [Wed, 9 Oct 2019 23:14:03 +0000 (19:14 -0400)] 
changed test_join functions to unique names

5 years agouse slots for lexer lstrip marker
David Lord [Mon, 7 Oct 2019 17:11:00 +0000 (10:11 -0700)] 
use slots for lexer lstrip marker

5 years agoadd changelog for #938
David Lord [Mon, 7 Oct 2019 14:42:04 +0000 (07:42 -0700)] 
add changelog for #938

5 years agoMerge pull request #938 from stevenorum/master
David Lord [Mon, 7 Oct 2019 13:55:32 +0000 (06:55 -0700)] 
Merge pull request #938 from stevenorum/master

Fixing compiler handling of parens around boolean comparisons.

5 years agoadd changelog for #858
David Lord [Mon, 7 Oct 2019 06:42:36 +0000 (23:42 -0700)] 
add changelog for #858

5 years agoMerge pull request #858 from exponea/857-lexer-whitespace-performance
David Lord [Mon, 7 Oct 2019 06:41:04 +0000 (23:41 -0700)] 
Merge pull request #858 from exponea/857-lexer-whitespace-performance

Fix lexer being extremely slow on large amounts of whitespace. Fixes #857

5 years agoadd comments about lstrip code 858/head
David Lord [Mon, 7 Oct 2019 06:37:16 +0000 (23:37 -0700)] 
add comments about lstrip code

5 years agoMerge branch 'master' into 857-lexer-whitespace-performance
David Lord [Mon, 7 Oct 2019 06:28:18 +0000 (23:28 -0700)] 
Merge branch 'master' into 857-lexer-whitespace-performance

5 years agoMerge pull request #1071 from btharper/pytest-raises
David Lord [Sun, 6 Oct 2019 04:20:38 +0000 (21:20 -0700)] 
Merge pull request #1071 from btharper/pytest-raises

Eliminate dead code by using pytests.raises instead of try/except/else

5 years agoEliminate dead code by using pytests.raises instead of try/except/else 1071/head
btharper [Sun, 6 Oct 2019 04:00:24 +0000 (00:00 -0400)] 
Eliminate dead code by using pytests.raises instead of try/except/else

5 years agoMerge pull request #983 from kevin-brown/pr/798
David Lord [Sat, 5 Oct 2019 02:17:41 +0000 (19:17 -0700)] 
Merge pull request #983 from kevin-brown/pr/798

Add support for a {% debug %} extension tag.

5 years agodocument debug extension 983/head
David Lord [Sat, 5 Oct 2019 02:00:11 +0000 (19:00 -0700)] 
document debug extension

5 years agodon't bypass autoescape
David Lord [Sat, 5 Oct 2019 01:23:11 +0000 (18:23 -0700)] 
don't bypass autoescape

5 years agoAdd support for a {% debug %} extension tag.
Shaheed Haque [Sun, 14 Jan 2018 14:01:22 +0000 (14:01 +0000)] 
Add support for a {% debug %} extension tag.
This dumps the available variables, filters and tests.

5 years agoMerge pull request #1047 from lfdebrux/ldeb-bug-chainable_undefined_and_markup
David Lord [Fri, 4 Oct 2019 20:11:20 +0000 (13:11 -0700)] 
Merge pull request #1047 from lfdebrux/ldeb-bug-chainable_undefined_and_markup

Fix bug with when using Markup on ChainableUndefined

5 years agoFix bug with when using Markup on ChainableUndefined 1047/head
Laurence de Bruxelles [Sat, 10 Aug 2019 21:08:39 +0000 (22:08 +0100)] 
Fix bug with when using Markup on ChainableUndefined

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.

5 years agoMerge branch '2.10.x'
David Lord [Fri, 4 Oct 2019 19:53:44 +0000 (12:53 -0700)] 
Merge branch '2.10.x'

5 years agoMerge pull request #1070 from anowlcalledjosh/develop
David Lord [Fri, 4 Oct 2019 19:51:47 +0000 (12:51 -0700)] 
Merge pull request #1070 from anowlcalledjosh/develop

Fix incorrect release date for 2.10.3

5 years agoFix incorrect release date for 2.10.3 1070/head
Josh Holland [Fri, 4 Oct 2019 19:38:17 +0000 (20:38 +0100)] 
Fix incorrect release date for 2.10.3

5 years agoMerge pull request #828 from chamini2/trim-more
David Lord [Fri, 4 Oct 2019 19:01:37 +0000 (12:01 -0700)] 
Merge pull request #828 from chamini2/trim-more

Add chars option to trim

5 years agoMerge branch '2.10.x'
David Lord [Fri, 4 Oct 2019 18:59:18 +0000 (11:59 -0700)] 
Merge branch '2.10.x'

5 years agorelease version 2.10.3 2.10.3
David Lord [Fri, 4 Oct 2019 18:50:02 +0000 (11:50 -0700)] 
release version 2.10.3

5 years agoFix typo in setup.py
Adrian [Fri, 4 Oct 2019 18:46:10 +0000 (20:46 +0200)] 
Fix typo in setup.py