[Zope3-checkins] CVS: Zope3/src/zope/app/apidoc/ifacemodule -
browser.py:1.4
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 9 07:39:33 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/apidoc/ifacemodule
In directory cvs.zope.org:/tmp/cvs-serv9939/src/zope/app/apidoc/ifacemodule
Modified Files:
browser.py
Log Message:
Adjusted code to use utility service to look up factories or use the new zapi
methods.
=== Zope3/src/zope/app/apidoc/ifacemodule/browser.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/apidoc/ifacemodule/browser.py:1.3 Fri Mar 5 17:08:51 2004
+++ Zope3/src/zope/app/apidoc/ifacemodule/browser.py Tue Mar 9 07:39:02 2004
@@ -157,15 +157,10 @@
def getFactories(self):
"""Return the factories, who will provide objects implementing this
interface."""
- service = zapi.getService(self.context, 'Factories')
- try:
- factories = service.getFactoriesFor(removeAllProxies(self.context))
- except ComponentLookupError:
- return []
- return [{'name': n,
- 'factory': f,
- 'title': service.getFactoryInfo(n).title
- } for n, f in factories]
+ iface = removeAllProxies(self.context)
+ return [{'name': n, 'factory': f, 'title': f.title} \
+ for n, f in zapi.queryUtilitiesFor(IFactory, ()) \
+ if ISource in tuple(f.getInterfaces)]
def getUtilities(self):
"""Return all utilities that provide this interface."""
More information about the Zope3-Checkins
mailing list