Mercurial > p > roundup > code
comparison roundup/cgi/PageTemplates/TALES.py @ 5837:883c9e90b403
Fix problem with cgi.escape being depricated a different way. This way
uses anypy and is cleaner. Also fixes incorrect/incomplete change that
resulted in escaped in TAL generated by TALInterpreter.py. The escaped
quotes break javascript etc. defined using tal string: values.
TODO: add test cases for TAL. This wouldn't have snuck through for a
month if we had good coverage of that library.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 06 Jul 2019 13:12:58 -0400 |
| parents | 56c9bcdea47f |
| children | 408fd477761f |
comparison
equal
deleted
inserted
replaced
| 5836:75586a0c26c0 | 5837:883c9e90b403 |
|---|---|
| 281 data = self.context.contexts.copy() | 281 data = self.context.contexts.copy() |
| 282 s = pprint.pformat(data) | 282 s = pprint.pformat(data) |
| 283 if not as_html: | 283 if not as_html: |
| 284 return ' - Names:\n %s' % s.replace('\n', '\n ') | 284 return ' - Names:\n %s' % s.replace('\n', '\n ') |
| 285 else: | 285 else: |
| 286 from cgi import escape | 286 from roundup.anypy.html import html_escape |
| 287 return '<b>Names:</b><pre>%s</pre>' % (escape(s)) | 287 return '<b>Names:</b><pre>%s</pre>' % (html_escape(s)) |
| 288 | 288 |
| 289 | 289 |
| 290 class SimpleExpr: | 290 class SimpleExpr: |
| 291 '''Simple example of an expression type handler''' | 291 '''Simple example of an expression type handler''' |
| 292 def __init__(self, name, expr, engine): | 292 def __init__(self, name, expr, engine): |
