pyramid scaffolding collides with jinja2 templating #534

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Contributor

dfee commented Apr 14, 2012

When Pyramid scaffolding finds files with the suffix _templ, it inspects the file for variables such as {{project}}, {{package}}, and {{package_logger}} and replaces them. However, when using Jinja2 templates, this collides with standard variable replacement, and the outcome is that pcreate dies.

To solve this problem, I've added a function substitute_escaped_double_braces that takes values the following string: "\{\{ mystring \}\}" and exports "{{ mystring }}". This is handy because it allows a developer to use other templating languages without generating collisions.

Owner

mmerickel commented Apr 14, 2012

This'll definitely need some tests :-)

It should be a matter of just adding your escaped pattern to one of the templates in the scaffold test project and a test to ensure that the pattern is still in the rendered template.

wutali commented Feb 18, 2013

I added a test case for this on the issue #862.

tseaver closed this Feb 18, 2013

Owner

tseaver commented Feb 18, 2013

Track in #862

Owner

mcdonc commented Aug 28, 2013

@dfee, i merged this with @wutali's tests.. if you want, you could submit a pull request adding yourself to CONTRIBUTORS.txt. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment