[rhmessaging-commits] rhmessaging commits: r1164 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Oct 25 16:58:09 EDT 2007


Author: justi9
Date: 2007-10-25 16:58:09 -0400 (Thu, 25 Oct 2007)
New Revision: 1164

Modified:
   mgmt/cumin/python/cumin/charts.py
Log:
Stop writing the chart png in a very hoaky way.



Modified: mgmt/cumin/python/cumin/charts.py
===================================================================
--- mgmt/cumin/python/cumin/charts.py	2007-10-25 20:38:14 UTC (rev 1163)
+++ mgmt/cumin/python/cumin/charts.py	2007-10-25 20:58:09 UTC (rev 1164)
@@ -58,8 +58,8 @@
         cr.move_to(x, self.height)
         cr.show_text("0")
 
-    def write(self, name):
-        self.surface.write_to_png(name)
+    def write(self, writer):
+        self.surface.write_to_png(writer)
 
 class QueueChartPage(Page):
     def __init__(self, app, name):
@@ -86,6 +86,8 @@
         measures = [queue.get_measurement(x) \
                     for x in self.measurements.get(session)]
 
+        # XXX only get the max of the values we're going to display
+
         max_value = 0
         for m in measures:
             max_value = max(max(m.values), max_value)
@@ -103,8 +105,6 @@
         
         chart.plot_frame()
 
-        name = "/tmp/whoa.png"
-        chart.write(name)
-        file = open(name, "r")
-
-        return file.read()
+        writer = Writer()
+        chart.write(writer)
+        return writer.to_string()




More information about the rhmessaging-commits mailing list