[Zope3-checkins] CVS: Zope3/src/zope/component - interfaces.py:1.5
Jim Fulton
jim@zope.com
Fri, 23 May 2003 18:17:34 -0400
Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv20047/src/zope/component
Modified Files:
interfaces.py
Log Message:
Removed the unused queryServiceManager.
=== Zope3/src/zope/component/interfaces.py 1.4 => 1.5 ===
--- Zope3/src/zope/component/interfaces.py:1.4 Wed May 21 16:30:05 2003
+++ Zope3/src/zope/component/interfaces.py Fri May 23 18:17:33 2003
@@ -26,16 +26,23 @@
# basic service manager tools
def getServiceManager(context):
- """returns the nearest service manager to the context; if the
- context is None the global service manager is always returned"""
+ """Get the service manager
+
+ Return the nearest service manager to the context; if the
+ context is None the global service manager is always returned
+ """
def getService(context, name):
- """returns the service defined by 'name' nearest to the context;
+ """Get a named service.
+
+ Returns the service defined by 'name' nearest to the context;
if the context is None the pertinent global service is always
returned"""
def getServiceDefinitions(context):
- """returns a dictionary of the service definitions pertinent to
+ """Get service definitions
+
+ Returns a dictionary of the service definitions pertinent to
the given context, in the format {nameString: serviceInterface}.
If the context is None the global definitions will be returned.
The default behavior of placeful service managers is to include
@@ -125,7 +132,7 @@
def createObject(context, name, *args, **kwargs):
"""Create an object using a factory
- finds the factory of the given name that is nearest to the
+ Finds the factory of the given name that is nearest to the
context, and passes the other given arguments to the factory
to create a new instance. Returns a reference to the new
object. If a matching factory cannot be found raises
@@ -133,8 +140,28 @@
"""
+ def getFactory(context, name):
+ """Get a factory
+
+ Get the factory of the given name that is nearest to the
+ context. If a matching factory cannot be found raises
+ ComponentLookupError
+
+ """
+
+ def queryFactory(context, name, default=None):
+ """Get a factory
+
+ Get the factory of the given name that is nearest to the
+ context. If a matching factory cannot be found then the
+ default is returned.
+
+ """
+
def getFactoryInterfaces(context, name):
- """finds the factory of the given name that is nearest to the
+ """Get interfaces implemented by a factory
+
+ finds the factory of the given name that is nearest to the
context, and returns the interface or interface tuple that
object instances created by the named factory will implement."""