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

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Oct 15 11:23:25 EDT 2007


Author: justi9
Date: 2007-10-15 11:23:25 -0400 (Mon, 15 Oct 2007)
New Revision: 1069

Modified:
   mgmt/cumin/python/cumin/exchange.py
   mgmt/cumin/python/cumin/queue.py
   mgmt/cumin/python/cumin/server.py
   mgmt/cumin/python/cumin/widgets.py
   mgmt/cumin/python/wooly/forms.py
Log:
Renames on_* form processing methods to process_*, to reflect the
pattern where methods called as part of process or render are prefixed
with "process_" or "render_".



Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py	2007-10-15 15:12:25 UTC (rev 1068)
+++ mgmt/cumin/python/cumin/exchange.py	2007-10-15 15:23:25 UTC (rev 1069)
@@ -172,12 +172,12 @@
         return valid
 
 class ExchangeAdd(ExchangeForm):
-    def on_cancel(self, session, vhost):
+    def process_cancel(self, session, vhost):
         branch = session.branch()
         self.page().show_virtual_host(branch, vhost).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_submit(self, session, vhost):
+    def process_submit(self, session, vhost):
         if self.validate(session):
             exchange = Exchange(self.app.model)
 
@@ -198,12 +198,12 @@
         return "Add Exchange to Host Template '%s'" % vhost.name
         
 class ExchangeEdit(ExchangeForm):
-    def on_cancel(self, session, exchange):
+    def process_cancel(self, session, exchange):
         branch = session.branch()
         self.page().show_exchange(branch, exchange).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_submit(self, session, exchange):
+    def process_submit(self, session, exchange):
         if self.validate(session):
             exchange.lock()
             try:
@@ -216,7 +216,7 @@
             self.page().show_exchange(branch, exchange).show_view(branch)
             session.set_redirect(branch.marshal())
 
-    def on_display(self, session, exchange):
+    def process_display(self, session, exchange):
         self.exchange_name.set(session, exchange.name)
         self.type.set(session, exchange.type)
 
@@ -224,7 +224,7 @@
         return "Edit Exchange '%s'" % exchange.name
 
 class ExchangeRemove(CuminConfirmForm):
-    def on_confirm(self, session, exchange):
+    def process_confirm(self, session, exchange):
         vhost = exchange.get_virtual_host()
 
         exchange.remove()
@@ -233,7 +233,7 @@
         self.page().show_virtual_host(branch, vhost).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_cancel(self, session, exchange):
+    def process_cancel(self, session, exchange):
         branch = session.branch()
         self.page().show_exchange(branch, exchange).show_view(branch)
         session.set_redirect(branch.marshal())

Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py	2007-10-15 15:12:25 UTC (rev 1068)
+++ mgmt/cumin/python/cumin/queue.py	2007-10-15 15:23:25 UTC (rev 1069)
@@ -208,12 +208,12 @@
         return valid
 
 class QueueAdd(QueueForm):
-    def on_cancel(self, session, vhost):
+    def process_cancel(self, session, vhost):
         branch = session.branch()
         self.page().show_virtual_host(branch, vhost).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_submit(self, session, vhost):
+    def process_submit(self, session, vhost):
         if self.validate(session):
             queue = Queue(self.app.model)
 
@@ -234,12 +234,12 @@
         return "Add Queue to Host Template '%s'" % vhost.name
         
 class QueueEdit(QueueForm):
-    def on_cancel(self, session, queue):
+    def process_cancel(self, session, queue):
         branch = session.branch()
         self.page().show_queue(branch, queue).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_submit(self, session, queue):
+    def process_submit(self, session, queue):
         if self.validate(session):
             queue.lock()
             try:
@@ -252,7 +252,7 @@
             self.page().show_queue(branch, queue).show_view(branch)
             session.set_redirect(branch.marshal())
 
-    def on_display(self, session, queue):
+    def process_display(self, session, queue):
         self.queue_name.set(session, queue.name)
         self.latency_priority.set(session, queue.latency_priority)
 
@@ -260,7 +260,7 @@
         return "Edit Queue '%s'" % queue.name
 
 class QueueRemove(CuminConfirmForm):
-    def on_confirm(self, session, queue):
+    def process_confirm(self, session, queue):
         vhost = queue.get_virtual_host()
 
         queue.remove()
@@ -269,7 +269,7 @@
         self.page().show_virtual_host(branch, vhost).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_cancel(self, session, queue):
+    def process_cancel(self, session, queue):
         branch = session.branch()
         self.page().show_queue(branch, queue).show_view(branch)
         session.set_redirect(branch.marshal())
@@ -296,7 +296,7 @@
     def render_title(self, session, queue):
         return "Add Binding to Queue '%s'" % queue.name
 
-    def on_cancel(self, session, queue):
+    def process_cancel(self, session, queue):
         branch = session.branch()
         self.page().show_queue(branch, queue).show_view(branch)
         session.set_redirect(branch.marshal())
@@ -318,7 +318,7 @@
 
         return valid
 
-    def on_submit(self, session, queue):
+    def process_submit(self, session, queue):
         if self.validate(session):
             binding = Binding(self.app.model)
 
@@ -340,12 +340,12 @@
                           lambda x: x.name)
 
 class QueueBindingRemove(CuminConfirmForm):
-    def on_confirm(self, session, binding):
+    def process_confirm(self, session, binding):
         branch = session.branch()
         self.page().show_queue(branch, binding.get_queue()).show_view(branch)
         session.set_redirect(branch.marshal())
 
-    def on_cancel(self, session, binding):
+    def process_cancel(self, session, binding):
         branch = session.branch()
         self.page().show_queue(branch, binding.get_queue()).show_view(branch)
         session.set_redirect(branch.marshal())

Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py	2007-10-15 15:12:25 UTC (rev 1068)
+++ mgmt/cumin/python/cumin/server.py	2007-10-15 15:23:25 UTC (rev 1069)
@@ -240,7 +240,7 @@
         self.group_name = TextInput(app, "name", self)
         self.add_child(self.group_name)
 
-    def on_submit(self, session, object):
+    def process_submit(self, session, object):
         if object is self.app.model:
             group = ServerGroup(object)
         else:
@@ -257,7 +257,7 @@
         self.page().show_server_group(branch, group)
         session.set_redirect(branch.marshal())
 
-    def on_cancel(self, session, model):
+    def process_cancel(self, session, model):
         branch = session.branch()
         self.page().show_view(branch)
         session.set_redirect(branch.marshal())
@@ -279,7 +279,7 @@
     def set_server_group(self, session, group):
         self.param.set(session, group)
 
-    def on_display(self, session, group):
+    def process_display(self, session, group):
         self.group_name.set(session, group.name)
 
     def render_title(self, session, group):

Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py	2007-10-15 15:12:25 UTC (rev 1068)
+++ mgmt/cumin/python/cumin/widgets.py	2007-10-15 15:23:25 UTC (rev 1069)
@@ -47,21 +47,21 @@
         if self.cancel.get(session):
             self.cancel.set(session, False)
 
-            self.on_cancel(session, object)
+            self.process_cancel(session, object)
         elif self.submit.get(session):
             self.submit.set(session, False)
 
-            self.on_submit(session, object)
+            self.process_submit(session, object)
         else:
-            self.on_display(session, object)
+            self.process_display(session, object)
 
-    def on_cancel(self, session, object):
+    def process_cancel(self, session, object):
         pass
 
-    def on_submit(self, session, object):
+    def process_submit(self, session, object):
         pass
 
-    def on_display(self, session, object):
+    def process_display(self, session, object):
         pass
 
     class Cancel(FormButton):
@@ -89,21 +89,21 @@
         if self.confirm.get(session):
             self.confirm.set(session, False)
 
-            self.on_confirm(session, object)
+            self.process_confirm(session, object)
         elif self.cancel.get(session):
             self.cancel.set(session, False)
 
-            self.on_cancel(session, object)
+            self.process_cancel(session, object)
         else:
-            self.on_display(session, object)
+            self.process_display(session, object)
 
-    def on_cancel(self, session, object):
+    def process_cancel(self, session, object):
         pass
 
-    def on_confirm(self, session, object):
+    def process_confirm(self, session, object):
         pass
 
-    def on_display(self, session, object):
+    def process_display(self, session, object):
         pass
 
     def render_confirm_content(self, session, object):

Modified: mgmt/cumin/python/wooly/forms.py
===================================================================
--- mgmt/cumin/python/wooly/forms.py	2007-10-15 15:12:25 UTC (rev 1068)
+++ mgmt/cumin/python/wooly/forms.py	2007-10-15 15:23:25 UTC (rev 1069)
@@ -142,9 +142,9 @@
         if self.get(session):
             self.set(session, False)
 
-            self.on_submit(session, object)
+            self.process_submit(session, object)
 
-    def on_submit(self, session, object):
+    def process_submit(self, session, object):
         pass
 
     def render_value(self, session, object):




More information about the rhmessaging-commits mailing list