Oni
2010-12-08 02:09:50 UTC
The below produces 'Hello' which is great:
<p py:def="greeting()" py:strip="True">Hello</p>
<div py:choose="">
<span py:when="0 == len('%s' % greeting)">nothing</span>
<span py:when="0 != len('%s' % greeting)">${greeting()}</span>
<span py:otherwise="">otherwise</span>
</div>
However the below returns blank; but I would like it to return the
text 'nothing' or 'otherwise'.
<p py:def="greetingtwo()" py:strip="True"></p>
<div py:choose="">
<span py:when="0 == len('%s' % greetingtwo)">nothing</span>
<span py:when="0 != len('%s' % greetingtwo)">${greetingtwo()}</
span>
<span py:otherwise="">otherwise</span>
</div>
The interesting thing is
<div py:with="x=greeting()">
"${x}" <br />
"$x" <br />
</div>
Returns:
"Hello"
""
But when I try to use $ or ${..} in the below genshi comes up with
errors
<div py:choose="">
<span py:when="0 == len('%s' % $greetingtwo)">nothing</span>
<span py:when="0 != len('%s' % $greetingtwo)">${greetingtwo()}</
span>
<span py:otherwise="">otherwise</span>
</div>
Any insights or handy hints appreciated
<p py:def="greeting()" py:strip="True">Hello</p>
<div py:choose="">
<span py:when="0 == len('%s' % greeting)">nothing</span>
<span py:when="0 != len('%s' % greeting)">${greeting()}</span>
<span py:otherwise="">otherwise</span>
</div>
However the below returns blank; but I would like it to return the
text 'nothing' or 'otherwise'.
<p py:def="greetingtwo()" py:strip="True"></p>
<div py:choose="">
<span py:when="0 == len('%s' % greetingtwo)">nothing</span>
<span py:when="0 != len('%s' % greetingtwo)">${greetingtwo()}</
span>
<span py:otherwise="">otherwise</span>
</div>
The interesting thing is
<div py:with="x=greeting()">
"${x}" <br />
"$x" <br />
</div>
Returns:
"Hello"
""
But when I try to use $ or ${..} in the below genshi comes up with
errors
<div py:choose="">
<span py:when="0 == len('%s' % $greetingtwo)">nothing</span>
<span py:when="0 != len('%s' % $greetingtwo)">${greetingtwo()}</
span>
<span py:otherwise="">otherwise</span>
</div>
Any insights or handy hints appreciated
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to genshi+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/genshi?hl=en.
You received this message because you are subscribed to the Google Groups "Genshi" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to genshi+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/genshi?hl=en.