[Zope3-checkins] CVS: Zope3/src/zope/app/utility/browser - __init__.py:1.6

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Apr 17 10:34:17 EDT 2004


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

Modified Files:
	__init__.py 
Log Message:


Get rid of getRegisteredMatching().




=== Zope3/src/zope/app/utility/browser/__init__.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/utility/browser/__init__.py:1.5	Fri Apr  9 10:05:52 2004
+++ Zope3/src/zope/app/utility/browser/__init__.py	Sat Apr 17 10:33:47 2004
@@ -170,24 +170,22 @@
         return s
 
     def getConfigs(self):
+        utils = removeAllProxies(self.context)
         L = []
-        for iface, name, cr in self.context.getRegisteredMatching():
-            active = obj = cr.active()
-            if obj is None:
-                obj = cr.info()[0]['registration'] # Pick a representative
-            ifname = interfaceToName(self.context, iface)
+        for registration in utils.registrations(localOnly=True):
+            ifname = interfaceToName(self.context, registration.provided)
             d = {"interface": ifname,
-                 "name": name,
+                 "name": registration.name,
                  "url": "",
-                 "summary": obj.usageSummary(),
+                 "summary": registration.usageSummary(),
                  "configurl": ("@@configureutility.html?interface=%s&name=%s"
-                               % (ifname, name)),
+                               % (ifname, registration.name)),
                  }
-            if active is not None:
-                d["url"] = str(zapi.getView(active.getComponent(),
-                                            "absolute_url",
-                                            self.request))
-            L.append((ifname, name, d))
+            stack = utils.queryRegistrationsFor(registration)
+            if stack.active():
+                d["url"] = str(zapi.getView(registration.component,
+                                            "absolute_url", self.request))
+            L.append((ifname, registration.name, d))
         L.sort()
         return [d for ifname, name, d in L]
 




More information about the Zope3-Checkins mailing list