[rhmessaging-commits] rhmessaging commits: r3179 - in mgmt/trunk: cumin/python/cumin and 1 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Mar 19 14:21:52 EDT 2009


Author: justi9
Date: 2009-03-19 14:21:52 -0400 (Thu, 19 Mar 2009)
New Revision: 3179

Modified:
   mgmt/trunk/basil/python/basil/server.py
   mgmt/trunk/cumin/python/cumin/__init__.py
   mgmt/trunk/cumin/python/cumin/broker.py
   mgmt/trunk/cumin/python/cumin/brokerlink.py
   mgmt/trunk/cumin/python/cumin/widgets.py
   mgmt/trunk/wooly/python/wooly/__init__.py
   mgmt/trunk/wooly/python/wooly/tables.py
Log:
Rename get_orderby_sql to get_order_by_sql.

Initialize app pages starting from an app-level init method; that's
more straightforward than doing it on page add as we were doing
before.



Modified: mgmt/trunk/basil/python/basil/server.py
===================================================================
--- mgmt/trunk/basil/python/basil/server.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/basil/python/basil/server.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -27,6 +27,8 @@
         self.enable_debug()
 
     def init(self):
+        super(BasilApplication, self).init()
+
         self.model.init()
 
     def start(self):

Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/__init__.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -76,6 +76,8 @@
         self.model.check()
 
     def init(self):
+        super(Cumin, self).init()
+
         self.model.init()
 
     def start(self):

Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/broker.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -101,7 +101,7 @@
         def render_title(self, session, data):
             return "Groups"
 
-        def get_orderby_sql(self, session):
+        def get_order_by_sql(self, session):
             return None
 
         def render_content(self, session, data):

Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -75,7 +75,7 @@
             name = "%s:%i" % (data["host"], data["port"])
             return fmt_link(href, fmt_shorten(name))
 
-        def get_orderby_sql(self, session):
+        def get_order_by_sql(self, session):
             dir = self.parent.is_reversed(session) and "desc" or "asc"
             return "order by host, port %s" % dir
 
@@ -170,7 +170,7 @@
         def render_content(self, session, data):
             return "%s:%i" % (data["host"], data["port"])
 
-        def get_orderby_sql(self, session):
+        def get_order_by_sql(self, session):
             dir = self.parent.is_reversed(session) and "desc" or "asc"
             return "order by l.host, l.port %s" % dir
 

Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/cumin/python/cumin/widgets.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -731,7 +731,7 @@
         return "where %s" % " and ".join(constraints)
 
 class NullSortColumn(SqlTableColumn):
-    def get_orderby_sql(self, session):
+    def get_order_by_sql(self, session):
         key = self.get_column_key(session)
 
         if key:

Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/wooly/python/wooly/__init__.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -423,6 +423,10 @@
     def enable_debug(self):
         self.debug = self.Debug(self)
 
+    def init(self):
+        for page in self.pages:
+            page.init()
+
     class Debug(object):
         def __init__(self, app):
             self.app = app
@@ -440,9 +444,6 @@
         self.pages.append(page)
         self.pages_by_name[page.name] = page
 
-        # XXX I don't think this should be triggered here
-        page.init()
-
     def set_default_page(self, page):
         self.pages_by_name[""] = page
 

Modified: mgmt/trunk/wooly/python/wooly/tables.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/tables.py	2009-03-19 18:06:01 UTC (rev 3178)
+++ mgmt/trunk/wooly/python/wooly/tables.py	2009-03-19 18:21:52 UTC (rev 3179)
@@ -129,7 +129,7 @@
         return str(value)
 
     # in case a non-sql column is included in an sqltable # XXX ugh
-    def get_orderby_sql(self, session):
+    def get_order_by_sql(self, session):
         pass
 
 class ItemTableColumnHeader(Widget):
@@ -193,7 +193,7 @@
     def render_sql_orderby(self, session, *args):
         scol = self.get_selected_column(session)
         if scol:
-            return scol.get_orderby_sql(session)
+            return scol.get_order_by_sql(session)
 
     def render_sql_limit(self, session, *args):
         return None
@@ -312,10 +312,7 @@
         return rows
 
 class SqlTableColumn(ItemTableColumn):
-    # XXX to be consistent with similar methods, rename to
-    # get_sql_order_by
-
-    def get_orderby_sql(self, session):
+    def get_order_by_sql(self, session):
         key = self.get_column_key(session)
 
         if key:




More information about the rhmessaging-commits mailing list