wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

multi-line python statements in tal:define #34

Closed iksteen closed 10 years ago

iksteen commented 10 years ago

The following example results in an error when parsing the template using pot-create:

<div tal:define="structural field.widget.hidden or
                            field.widget.category == 'structural'">
</div>

The error message is:

Aborting due to Python syntax error in %s[%d]: %s ./test.pt 1 field.widget.hidden or
                            field.widget.category == 'structural'

The example does work when parsed by chameleon.

Possible workarounds are adding a \ after or or removing the line break.