[Checkins] SVN: Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt Add a failing test

Wichert Akkerman wichert at wiggy.net
Fri Sep 26 11:54:31 EDT 2008


Log message for revision 91530:
  Add a failing test

Changed:
  U   Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt

-=-
Modified: Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt
===================================================================
--- Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt	2008-09-26 15:50:13 UTC (rev 91529)
+++ Sandbox/malthe/chameleon.genshi/src/chameleon/genshi/language.txt	2008-09-26 15:54:30 UTC (rev 91530)
@@ -435,4 +435,28 @@
   <BLANKLINE>
   </div>
 
+
+  You can use a loop variable with py:with:
+
+  >>> print render("""\
+  ... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+  ...     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+  ... <html xmlns="http://www.w3.org/1999/xhtml"
+  ...       xmlns:py="http://genshi.edgewall.org/">
+  ...   <body>
+  ...     <div py:for="article in [dict(wfstate='new'), dict(wfstate='pending')]">
+  ...       <span py:choose="article['wfstate']"/>
+  ...     </div>
+  ...   </body>
+  ... </html>""")
+  <html>
+    <body>
+      <div>
+        <span/>
+        <span/>
+      </div>
+    </body>
+  </html>
+
+
 .. _py:with specs: http://genshi.edgewall.org/wiki/Documentation/0.4.x/xml-templates.html#py-with



More information about the Checkins mailing list