[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - service.py:1.9

Jim Fulton jim@zope.com
Mon, 10 Mar 2003 15:35:17 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv27592

Modified Files:
	service.py 
Log Message:
In the ServiceActivation view.  Renamed the "action" method to
"update" to be consistent with other self-posting forms.

In ServiceSummary changed the code to find information about the
active configuration so that it doesn't assume that the active
configuration is first in the list of configuration info objects
returned by the info method of the configuration registry.


=== Zope3/src/zope/app/browser/services/service.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/services/service.py:1.8	Fri Mar  7 20:51:38 2003
+++ Zope3/src/zope/app/browser/services/service.py	Mon Mar 10 15:35:16 2003
@@ -196,14 +196,8 @@
         for name in names:
             registry = self.context.queryConfigurations(name)
             assert registry
-            infos = registry.info()
-            assert infos
-            if infos[0]['active']:
-                # XXX This assumes if there is an active one it is the
-                # first one.  The implementation promises this, but
-                # the interface does not.  However Jim doesn't want
-                # the implementation changed so I guess the interface
-                # docs should be fixed.
+            infos = [info for info in registry.info() if info['active']]
+            if infos:
                 configobj = infos[0]['configuration']
                 component = configobj.getComponent()
                 url = str(getView(component, 'absolute_url', self.request))
@@ -245,7 +239,7 @@
             result.append(info)
         return result
 
-    def action(self):
+    def update(self):
         active = self.request.get("active")
         if not active:
             return ""