[Checkins] SVN: z3c.pt/trunk/z3c/pt/ Expressions that yield None
should print as the empty string.
Malthe Borch
mborch at gmail.com
Fri Feb 22 17:48:17 EST 2008
Log message for revision 84150:
Expressions that yield None should print as the empty string.
Changed:
U z3c.pt/trunk/z3c/pt/BENCHMARKS.txt
U z3c.pt/trunk/z3c/pt/clauses.py
U z3c.pt/trunk/z3c/pt/translation.txt
-=-
Modified: z3c.pt/trunk/z3c/pt/BENCHMARKS.txt
===================================================================
--- z3c.pt/trunk/z3c/pt/BENCHMARKS.txt 2008-02-22 22:41:41 UTC (rev 84149)
+++ z3c.pt/trunk/z3c/pt/BENCHMARKS.txt 2008-02-22 22:48:17 UTC (rev 84150)
@@ -48,7 +48,7 @@
... Hello World!
... </div>"""
- >>> for i in range(9000000): a = hello_world()
+ >>> # for i in range(9000000): a = hello_world()
1000 x 10 table:
@@ -67,7 +67,7 @@
... </tr>
... </table>""")
- >>> # for i in range(40): a = template(table=table)
+ >>> for i in range(40): a = template(table=table)
>>> template = z3PageTemplate()
>>> template.pt_edit("""\
Modified: z3c.pt/trunk/z3c/pt/clauses.py
===================================================================
--- z3c.pt/trunk/z3c/pt/clauses.py 2008-02-22 22:41:41 UTC (rev 84149)
+++ z3c.pt/trunk/z3c/pt/clauses.py 2008-02-22 22:48:17 UTC (rev 84150)
@@ -473,6 +473,7 @@
if unicode_required_flag:
stream.write("_urf = %s" % expr)
+ stream.write("if _urf is None: _urf = ''")
stream.write("try:")
stream.indent()
stream.write("_out.write(str(_urf))")
Modified: z3c.pt/trunk/z3c/pt/translation.txt
===================================================================
--- z3c.pt/trunk/z3c/pt/translation.txt 2008-02-22 22:41:41 UTC (rev 84149)
+++ z3c.pt/trunk/z3c/pt/translation.txt 2008-02-22 22:48:17 UTC (rev 84150)
@@ -36,6 +36,7 @@
... <p tal:omit-tag="False">A paragraph here.</p>
... <span tal:replace="'Hello World!'">Hello Universe!</span>
... <span tal:content="'%s'" />
+ ... <span tal:content="None" />
... </div>
... """ % (u'La Pe\xf1a').encode('utf-8')
@@ -71,6 +72,7 @@
<p>A paragraph here.</p>
Hello World!
<span>La Peña</span>
+ <span></span>
</div>
Error handling
More information about the Checkins
mailing list