[Zope3-checkins] CVS: Zope3/lib/python/Interface/Registry - AdapterRegistry.py:1.4 IAdapterRegistry.py:1.4

Jim Fulton jim@zope.com
Thu, 19 Dec 2002 14:37:39 -0500


Update of /cvs-repository/Zope3/lib/python/Interface/Registry
In directory cvs.zope.org:/tmp/cvs-serv19366/Registry

Modified Files:
	AdapterRegistry.py IAdapterRegistry.py 
Log Message:
Changed getRegisteredMatching to allow interfaces, rather than
interface sequences to be passed.


=== Zope3/lib/python/Interface/Registry/AdapterRegistry.py 1.3 => 1.4 ===
--- Zope3/lib/python/Interface/Registry/AdapterRegistry.py:1.3	Mon Nov 18 15:40:16 2002
+++ Zope3/lib/python/Interface/Registry/AdapterRegistry.py	Thu Dec 19 14:37:38 2002
@@ -109,8 +109,15 @@
                               required_interfaces=None,
                               provided_interfaces=None):
 
+        
+        if IInterface.isImplementedBy(required_interfaces):
+            required_interfaces = (required_interfaces, )
 
         if provided_interfaces:
+
+            if IInterface.isImplementedBy(provided_interfaces):
+                provided_interfaces = (provided_interfaces, )
+            
             r = {}
 
             if required_interfaces:


=== Zope3/lib/python/Interface/Registry/IAdapterRegistry.py 1.3 => 1.4 ===
--- Zope3/lib/python/Interface/Registry/IAdapterRegistry.py:1.3	Mon Nov 18 15:40:16 2002
+++ Zope3/lib/python/Interface/Registry/IAdapterRegistry.py	Thu Dec 19 14:37:38 2002
@@ -82,6 +82,8 @@
 
     def getRegistered(require, provide):
         """return data registred specificly for the given interfaces
+
+        None is returned if nothing is registered.
         """
     
     def getRegisteredMatching(required_interfaces=None,
@@ -90,8 +92,11 @@
 
         Zero or more required and provided interfaces may be
         specified. Registration information matching any of the
-        specified interfaces is returned. The returned value is a
-        sequence of three-element tuples:
+        specified interfaces is returned.
+
+        The arguments may be interfaces, or sequences of interfaces.
+
+        The returned value is a sequence of three-element tuples:
 
         - required interface