[Zope3-checkins] CVS: Zope3/src/zope/app/component - hooks.py:1.14

Jim Fulton jim at zope.com
Wed Dec 17 05:07:02 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/component
In directory cvs.zope.org:/tmp/cvs-serv32466/src/zope/app/component

Modified Files:
	hooks.py 
Log Message:
Added a providing keyword argument to the methods for retrieving views
and resources to allow lookup by provided interface, as well as name.


=== Zope3/src/zope/app/component/hooks.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/component/hooks.py:1.13	Fri Nov 21 12:11:28 2003
+++ Zope3/src/zope/app/component/hooks.py	Wed Dec 17 05:07:01 2003
@@ -28,6 +28,7 @@
 from zope.app.interfaces.location import ILocation
 from zope.app.location import locate
 from zope.component.servicenames import Presentation
+from zope.interface import Interface
 
 def getServiceManager_hook(context, local=False, recurse=False):
 
@@ -62,11 +63,13 @@
     return sm
 
 
-def queryView(object, name, request, default=None, context=None):
+def queryView(object, name, request, default=None, context=None,
+              providing=Interface):
     if context is None:
         context = object
     views = getService(context, Presentation)
-    view = views.queryView(object, name, request, default=default)
+    view = views.queryView(object, name, request, default=default,
+                           providing=providing)
     if ILocation.isImplementedBy(view):
         locate(view, object, name)
 




More information about the Zope3-Checkins mailing list