[rhmessaging-commits] rhmessaging commits: r1133 - in mgmt/cumin/python: wooly and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Oct 22 10:58:59 EDT 2007


Author: justi9
Date: 2007-10-22 10:58:58 -0400 (Mon, 22 Oct 2007)
New Revision: 1133

Modified:
   mgmt/cumin/python/cumin/queue.py
   mgmt/cumin/python/wooly/__init__.py
Log:
Fixes a template rendering of None values.



Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py	2007-10-22 14:51:19 UTC (rev 1132)
+++ mgmt/cumin/python/cumin/queue.py	2007-10-22 14:58:58 UTC (rev 1133)
@@ -365,10 +365,7 @@
         return measure.get_high()
 
     def render_item_low(self, session, measure):
-        if measure.highlow:
-            print type(measure.get_low())
-            
-            return measure.get_low()
+        return measure.get_low()
 
     def render_item_average_value(self, session, measure):
         return "%0.2f" % (sum(measure.values) / float(len(measure.values)))

Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py	2007-10-22 14:51:19 UTC (rev 1132)
+++ mgmt/cumin/python/wooly/__init__.py	2007-10-22 14:58:58 UTC (rev 1133)
@@ -677,11 +677,19 @@
                 writer.write(elem)
             elif callable(elem):
                 result = elem(self.widget, session, object)
-                writer.write(result == None and "" or str(result))
+
+                if result is None:
+                    result = ""
+                    
+                writer.write(str(result))
             else:
                 result = elem.render(session, object)
-                writer.write(result == None and "" or str(result))
 
+                if result is None:
+                    result = ""
+                    
+                writer.write(str(result))
+
 class WidgetCall(object):
     def __init__(self, stack, widget, session, object):
         self.stack = stack




More information about the rhmessaging-commits mailing list