[Zope3-checkins] CVS: Zope3/src/zope/component - factory.py:1.5
interfaces.py:1.13
Sidnei da Silva
sidnei at x3ng.com.br
Mon Aug 25 11:14:40 EDT 2003
Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv6817/src/zope/component
Modified Files:
factory.py interfaces.py
Log Message:
Make getFactoriesFor(iface) return a list of tuples (name, factory) so it is actually useful for something
=== Zope3/src/zope/component/factory.py 1.4 => 1.5 ===
--- Zope3/src/zope/component/factory.py:1.4 Tue Aug 5 10:25:13 2003
+++ Zope3/src/zope/component/factory.py Mon Aug 25 10:14:08 2003
@@ -72,8 +72,8 @@
def queryFactoriesFor(self, iface, default=None):
"""See IFactoryService interface"""
- return [factory for factory in self.__factories.values() \
- if iface in factory.getInterfaces()] or default
+ return [(n, f) for n, f in self.__factories.items() \
+ if iface in f.getInterfaces()] or default
_clear = __init__
=== Zope3/src/zope/component/interfaces.py 1.12 => 1.13 ===
--- Zope3/src/zope/component/interfaces.py:1.12 Wed Aug 6 17:16:51 2003
+++ Zope3/src/zope/component/interfaces.py Mon Aug 25 10:14:08 2003
@@ -327,16 +327,16 @@
object instances created by the named factory will implement."""
def getFactoriesFor(iface):
- """Return list of registered factories that create objects
- which implement the given interface
+ """Return a tuple (name, factory) of registered factories that
+ create objects which implement the given interface.
- A ComponentLookupError will be
- raised if the factory component can't be found.
+ A ComponentLookupError will be raised if the factory component
+ can't be found.
"""
def queryFactoriesFor(iface, default=None):
- """Return list of registered factories that create objects
- which implement the given interface
+ """Return a tuple (name, factory) list of registered factories
+ that create objects which implement the given interface
If no factory is found, the default value is returned.
"""
More information about the Zope3-Checkins
mailing list