diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-03 13:32:13 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-03 13:32:13 -0400 |
commit | 6cf6fbcbeb31bf30ba8c93b6335a77a9b735393f (patch) | |
tree | 7f67efca689defebc9907622b870db0387c37773 | |
parent | b5d915df67cf7851632e57acbacc822a8bafa22f (diff) | |
download | mako-6cf6fbcbeb31bf30ba8c93b6335a77a9b735393f.tar.gz |
use repr here
-rw-r--r-- | mako/ext/babelplugin.py | 6 | ||||
-rw-r--r-- | test/templates/gettext.mako | 2 | ||||
-rw-r--r-- | test/test_babelplugin.py | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/mako/ext/babelplugin.py b/mako/ext/babelplugin.py index 3b2bf51..4721949 100644 --- a/mako/ext/babelplugin.py +++ b/mako/ext/babelplugin.py @@ -78,9 +78,9 @@ def extract_nodes(nodes, keywords, comment_tags, options): elif isinstance(node, parsetree.CallNamespaceTag): attribs = ', '.join(['%s=%s' % ( key, - "'%s'" % val - if not val.startswith('${') - else val + repr(val) + if not val.startswith('${') + else val ) for key, val in node.attributes.items()]) diff --git a/test/templates/gettext.mako b/test/templates/gettext.mako index 9c01b61..367af55 100644 --- a/test/templates/gettext.mako +++ b/test/templates/gettext.mako @@ -80,7 +80,7 @@ top = gettext('Begin') <%def name="panel()"> -${_(u'foo')} <%self:block_tpl title="#123", name="_('baz')" value="${_('hoho')}"> +${_(u'foo')} <%self:block_tpl title="#123", name="_('baz')" value="${_('hoho')}" something="hi'there" somethingelse='hi"there'> ${_(u'bar')} diff --git a/test/test_babelplugin.py b/test/test_babelplugin.py index 6b867ee..4118f4a 100644 --- a/test/test_babelplugin.py +++ b/test/test_babelplugin.py @@ -3,10 +3,12 @@ from test import TemplateTest, template_base, skip_if try: import babel - from mako.ext.babelplugin import extract except: babel = None +if babel is not None: + from mako.ext.babelplugin import extract + import os |