Author: justi9
Date: 2008-01-14 09:07:57 -0500 (Mon, 14 Jan 2008)
New Revision: 1562
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/wooly/tables.py
mgmt/cumin/python/wooly/tables.strings
Log:
Restores column alignment.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-01-14 13:36:20 UTC (rev 1561)
+++ mgmt/cumin/python/cumin/client.py 2008-01-14 14:07:57 UTC (rev 1562)
@@ -47,9 +47,11 @@
#self.add_column(col)
col = self.SentColumn(app, "sent")
+ col.alignment = "right"
self.add_column(col)
col = self.ReceivedColumn(app, "received")
+ col.alignment = "right"
self.add_column(col)
self.unit = StateSwitch(app, "unit")
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-01-14 13:36:20 UTC (rev 1561)
+++ mgmt/cumin/python/cumin/exchange.py 2008-01-14 14:07:57 UTC (rev 1562)
@@ -64,18 +64,23 @@
self.add_column(col)
col = self.ProducersColumn(app, "name")
+ col.alignment = "right"
self.add_column(col)
col = self.BindingsColumn(app, "bindings")
+ col.alignment = "right"
self.add_column(col)
col = self.ReceivedColumn(app, "received")
+ col.alignment = "right"
self.add_column(col)
col = self.RoutedColumn(app, "routed")
+ col.alignment = "right"
self.add_column(col)
col = self.DroppedColumn(app, "dropped")
+ col.alignment = "right"
self.add_column(col)
self.unit = UnitSwitch(app, "unit")
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-01-14 13:36:20 UTC (rev 1561)
+++ mgmt/cumin/python/cumin/queue.py 2008-01-14 14:07:57 UTC (rev 1562)
@@ -55,18 +55,23 @@
self.set_default_column(col)
col = self.ConsumersColumn(app, "consumers")
+ col.alignment = "right"
self.add_column(col)
col = self.BindingsColumn(app, "bindings")
+ col.alignment = "right"
self.add_column(col)
col = self.EnqueuedColumn(app, "enqueued")
+ col.alignment = "right"
self.add_column(col)
col = self.DequeuedColumn(app, "dequeued")
+ col.alignment = "right"
self.add_column(col)
col = self.DepthColumn(app, "depth")
+ col.alignment = "right"
self.add_column(col)
self.unit = UnitSwitch(app, "unit")
Modified: mgmt/cumin/python/wooly/tables.py
===================================================================
--- mgmt/cumin/python/wooly/tables.py 2008-01-14 13:36:20 UTC (rev 1561)
+++ mgmt/cumin/python/wooly/tables.py 2008-01-14 14:07:57 UTC (rev 1562)
@@ -74,6 +74,10 @@
column, object = args
return column.get_title(session, object)
+ def render_header_class_attr(self, session, args):
+ column, object = args
+ return column.get_class_attr(session)
+
def render_cells(self, session, data):
data_map = dict()
@@ -96,11 +100,17 @@
def __init__(self, app, name):
super(ItemTableColumn, self).__init__(app, name)
+ self.alignment = None
+
def get_column_key(self, session):
return self.name
+ def get_class_attr(self, session):
+ return self.alignment == "right" and
"class=\"ralign\""
+
def do_render(self, session, data):
- return "<td>%s</td>" % self.render_content(session, data)
+ content = self.render_content(session, data)
+ return "<td %s>%s</td>" % (self.get_class_attr(session) or
"", content)
def render_content(self, session, data):
key = self.get_column_key(session)
Modified: mgmt/cumin/python/wooly/tables.strings
===================================================================
--- mgmt/cumin/python/wooly/tables.strings 2008-01-14 13:36:20 UTC (rev 1561)
+++ mgmt/cumin/python/wooly/tables.strings 2008-01-14 14:07:57 UTC (rev 1562)
@@ -5,7 +5,7 @@
</table>
[ItemTable.header_html]
-<th class="{header_class}"><a
href="{header_href}">{header_content}</a></th>
+<th {header_class_attr}><a
href="{header_href}">{header_content}</a></th>
[ItemTable.item_html]
<tr>{cells}</tr>