Re: [Paste] [Tempita] Minor Bug

18 views
Skip to first unread message

Ian Bicking

unread,
Sep 26, 2012, 12:46:33 PM9/26/12
to pierre-alain bourdil, paste...@googlegroups.com
Yeah, unfortunately this is just a limitation of how the Tempita is written, it would be hard to fix.  An unfortunately hard-to-read workaround would be ' \x7c\x7c '.join(mylist)


On Wed, Sep 26, 2012 at 3:21 AM, pierre-alain bourdil <pierreala...@gmail.com> wrote:
Hi,
sorry for posting this bug description here, but the trac instance from tempita docs is down (nginx error) .
It's impossible to write the following expression with Tempita 0.5  :

 {{" || ".join(mylist)}}.

The '|' caracters causes the parser to crash with the following message :

Traceback (most recent call last):
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 1183, in <module>
    fill_command()
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 1174, in fill_command
    result = template.substitute(vars)
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 173, in substitute
    result, defs, inherit = self._interpret(ns)
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 184, in _interpret
    self._interpret_codes(self._parsed, ns, out=parts, defs=defs)
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 212, in _interpret_codes
    self._interpret_code(item, ns, out, defs)
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 232, in _interpret_code
    base = self._eval(parts[0], ns, pos)
  File "/local/src/Tempita-0.5.1/tempita/__init__.py", line 297, in _eval
    'invalid syntax in expression: %s' % code)
SyntaxError: invalid syntax in expression: '

Writing a function doing this join in a py block , and then call that method at the same place is ok . I guess it has some link with the filter expression, so i've tried to escape the | using a backslash but this does note work.

+

--
You received this message because you are subscribed to the Google Groups "Paste Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/paste-users/-/HKm9RVI8JbcJ.
To post to this group, send email to paste...@googlegroups.com.
To unsubscribe from this group, send email to paste-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paste-users?hl=en.

Reply all
Reply to author
Forward
0 new messages