[Zope3-checkins] CVS: Zope3/src/zope/app/component - configure.zcml:1.8.10.1 hooks.py:1.11.2.3

Jim Fulton jim at zope.com
Tue Sep 9 18:45:39 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	configure.zcml hooks.py 
Log Message:
got more tests to pass on branch

=== Zope3/src/zope/app/component/configure.zcml 1.8 => 1.8.10.1 ===
--- Zope3/src/zope/app/component/configure.zcml:1.8	Sun Aug  3 15:08:16 2003
+++ Zope3/src/zope/app/component/configure.zcml	Tue Sep  9 17:45:08 2003
@@ -45,8 +45,8 @@
       implementation="zope.app.component.hooks.getServiceManager_hook" />
          
 <hook module="zope.component"
-      name="queryNamedAdapter"
-      implementation="zope.app.component.hooks.queryNamedAdapter" />
+      name="queryView"
+      implementation="zope.app.component.hooks.queryView" />
 
 <serviceType
     id='Interfaces'


=== Zope3/src/zope/app/component/hooks.py 1.11.2.2 => 1.11.2.3 ===
--- Zope3/src/zope/app/component/hooks.py:1.11.2.2	Tue Sep  9 16:31:56 2003
+++ Zope3/src/zope/app/component/hooks.py	Tue Sep  9 17:45:08 2003
@@ -25,7 +25,7 @@
 from zope.proxy import removeAllProxies
 from zope.security.proxy import trustedRemoveSecurityProxy
 from zope.app.traversing import IContainmentRoot
-
+from zope.app.interfaces.location import ILocation
 
 def getServiceManager_hook(context, local=False, recurse=False):
 
@@ -59,15 +59,14 @@
 
     return sm
 
-def queryNamedAdapter(object, interface, name, default=None, context=None):
+
+def queryView(object, name, request, default=None, context=None):
     if context is None:
         context = object
+    views = getService(context, 'Views')
+    view = views.queryView(object, name, request, default)
+    if ILocation.isImplementedBy(view):
+        view.__name__ = name
+        view.__parent__ = object
 
-    try:
-        adapters = getService(context, Adapters)
-    except ComponentLookupError:
-        # Oh blast, no adapter service. We're probably just
-        # running from a test
-        return default
-
-    return adapters.queryNamedAdapter(object, interface, name, default)
+    return view




More information about the Zope3-Checkins mailing list