[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/component/components.py Implement getUtilitiesFor and getAllUtilitiesRegisteredFor with Jim's help.

Philipp von Weitershausen philikon at philikon.de
Tue Feb 28 11:27:26 EST 2006


Log message for revision 65594:
  Implement getUtilitiesFor and getAllUtilitiesRegisteredFor with Jim's help.
  Still needs tests.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/component/components.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/component/components.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/component/components.py	2006-02-28 16:15:49 UTC (rev 65593)
+++ Zope3/branches/jim-adapter/src/zope/component/components.py	2006-02-28 16:27:25 UTC (rev 65594)
@@ -88,13 +88,14 @@
             raise interfaces.ComponentLookupError(provided, name)
         return utility
 
-    #TODO
-    def getUtilitiesFor(self, interface, context=None):
-        return []
+    #TODO needs tests
+    def getUtilitiesFor(self, interface):
+        for name, utility in self.utilities.lookupAll((), interface):
+            yield name, utility
 
-    #TODO
-    def getAllUtilitiesRegisteredFor(self, interface, context=None):
-        return []
+    #TODO needs tests
+    def getAllUtilitiesRegisteredFor(self, interface):
+        return self.utilities.subscriptions((), interface)
 
     def registerAdapter(self, factory, required=None, provided=None, name=u'',
                         info=u''):



More information about the Zope3-Checkins mailing list