[Mpuls-commits] r2294 - in wasko/branches/2.0: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 9 12:33:01 CEST 2010


Author: bh
Date: 2010-04-09 12:32:59 +0200 (Fri, 09 Apr 2010)
New Revision: 2294

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/lib/renderer.py
Log:
* mpulsweb/lib/renderer.py (ChoiceContainer.render)
(ViewRenderer.toTarget): Simplify the code.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-04-09 10:12:16 UTC (rev 2293)
+++ wasko/branches/2.0/ChangeLog	2010-04-09 10:32:59 UTC (rev 2294)
@@ -1,5 +1,10 @@
 2010-04-09  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/renderer.py (ChoiceContainer.render)
+	(ViewRenderer.toTarget): Simplify the code.
+
+2010-04-09  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/renderer.py (ViewRenderer._renderRecursive): Use
 	the meta object's getParsedContainers method instead of parsing
 	the containers value explicitly here.  Makes the code much

Modified: wasko/branches/2.0/mpulsweb/lib/renderer.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/renderer.py	2010-04-09 10:12:16 UTC (rev 2293)
+++ wasko/branches/2.0/mpulsweb/lib/renderer.py	2010-04-09 10:32:59 UTC (rev 2294)
@@ -202,12 +202,8 @@
 class ChoiceContainer(Container):
 
     def render(self, doBreak=True):
-        out = []
-        if self.items:
-            for col, w in self.items:
-                data = col.render(self.target, w or "")
-                out.append(data)
-        return "".join(out)
+        return "".join([col.render(self.target, w or "")
+                        for col, w in self.items])
 
 
 class ViewRenderer:
@@ -278,8 +274,7 @@
                 except (TypeError, ValueError):
                    pass
 
-        containersStack = self.containersStack
-        for container in containersStack[-1]:
+        for container in self.containersStack[-1]:
             if not container.target or container.target == target:
                 container.append(item, weight)
                 return



More information about the Mpuls-commits mailing list