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

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Oct 11 09:37:38 EDT 2007


Author: justi9
Date: 2007-10-11 09:37:38 -0400 (Thu, 11 Oct 2007)
New Revision: 1006

Modified:
   mgmt/cumin/python/cumin/virtualhost.py
Log:
Fixes a bug and simplifies vhost and vhost template code a little.



Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py	2007-10-11 13:15:13 UTC (rev 1005)
+++ mgmt/cumin/python/cumin/virtualhost.py	2007-10-11 13:37:38 UTC (rev 1006)
@@ -106,63 +106,28 @@
     def render_title(self, session, vhost):
         return "Host Template '%s'" % vhost.name
 
-class BaseVirtualHostView(Widget):
+class VirtualHostView(Widget):
     def __init__(self, app, name):
-        super(BaseVirtualHostView, self).__init__(app, name)
+        super(VirtualHostView, self).__init__(app, name)
 
         self.tabs = TabSet(app, "tabs")
         self.add_child(self.tabs)
 
-        self.queues = self.QueueTab(app, "queues")
+        self.queues = QueueSet(app, "queues")
         self.tabs.add_child(self.queues)
 
-        self.exchanges = self.ExchangeTab(app, "exchanges")
+        self.exchanges = ExchangeSet(app, "exchanges")
         self.tabs.add_child(self.exchanges)
 
-    def render_name(self, session, vhost):
-        return vhost.name
-
-    class QueueTab(Widget):
-        def __init__(self, app, name):
-            super(BaseVirtualHostView.QueueTab, self).__init__(app, name)
-
-            self.queues = QueueSet(app, "queues")
-            self.add_child(self.queues)
-
-        def render_title(self, session, vhost):
-            return self.queues.render_title(session, vhost)
-
-        def render_add_queue_href(self, session, vhost):
-            branch = session.branch()
-            self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
-            return branch.marshal()
-
-    class ExchangeTab(Widget):
-        def __init__(self, app, name):
-            super(BaseVirtualHostView.ExchangeTab, self).__init__(app, name)
-
-            self.exchanges = ExchangeSet(app, "exchanges")
-            self.add_child(self.exchanges)
-
-        def render_title(self, session, vhost):
-            return self.exchanges.render_title(session, vhost)
-
-        def render_add_exchange_href(self, session, vhost):
-            branch = session.branch()
-            frame = self.page().show_virtual_host(branch, vhost)
-            frame.show_exchange_add(branch)
-            return branch.marshal()
-
-class VirtualHostView(BaseVirtualHostView):
-    def __init__(self, app, name):
-        super(VirtualHostView, self).__init__(app, name)
-
         self.log = self.VirtualHostLog(app, "log")
         self.tabs.add_child(self.log)
 
     def render_title(self, session, vhost):
         return "Functional Host '%s'" % vhost.name
 
+    def render_name(self, session, vhost):
+        return vhost.name
+
     def render_server(self, session, vhost):
         server = vhost.get_server()
 
@@ -189,10 +154,25 @@
         def render_title(self, session, vhost):
             return "Log Messages"
 
-class VirtualHostTemplateView(VirtualHostView):
+class VirtualHostTemplateView(Widget):
+    def __init__(self, app, name):
+        super(VirtualHostTemplateView, self).__init__(app, name)
+
+        self.tabs = TabSet(app, "tabs")
+        self.add_child(self.tabs)
+
+        self.queues = self.QueueTab(app, "queues")
+        self.tabs.add_child(self.queues)
+
+        self.exchanges = self.ExchangeTab(app, "exchanges")
+        self.tabs.add_child(self.exchanges)
+
     def render_title(self, session, vhost):
         return "Host Template '%s'" % vhost.name
 
+    def render_name(self, session, vhost):
+        return vhost.name
+
     def render_add_queue_href(self, session, vhost):
         branch = session.branch()
         self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
@@ -202,3 +182,34 @@
         branch = session.branch()
         self.page().show_virtual_host(branch, vhost).show_exchange_add(branch)
         return branch.marshal()
+
+    class QueueTab(Widget):
+        def __init__(self, app, name):
+            super(VirtualHostTemplateView.QueueTab, self).__init__(app, name)
+
+            self.queues = QueueSet(app, "queues")
+            self.add_child(self.queues)
+
+        def render_title(self, session, vhost):
+            return self.queues.render_title(session, vhost)
+
+        def render_add_queue_href(self, session, vhost):
+            branch = session.branch()
+            self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
+            return branch.marshal()
+
+    class ExchangeTab(Widget):
+        def __init__(self, app, name):
+            super(VirtualHostTemplateView.ExchangeTab, self).__init__(app, name)
+
+            self.exchanges = ExchangeSet(app, "exchanges")
+            self.add_child(self.exchanges)
+
+        def render_title(self, session, vhost):
+            return self.exchanges.render_title(session, vhost)
+
+        def render_add_exchange_href(self, session, vhost):
+            branch = session.branch()
+            frame = self.page().show_virtual_host(branch, vhost)
+            frame.show_exchange_add(branch)
+            return branch.marshal()




More information about the rhmessaging-commits mailing list