[Zope3-checkins] CVS: Zope3/src/zope/app/traversing - namespace.py:1.21.2.1

Jim Fulton cvs-admin at zope.org
Sun Nov 9 11:09:00 EST 2003


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

Modified Files:
      Tag: adaptergeddon-branch
	namespace.py 
Log Message:
Created a global presentation service that replaces the 
global view, resource, and skin services.

Now look up presentation components by adapting from a request type,
rather than adapting to a presentation type.





=== Zope3/src/zope/app/traversing/namespace.py 1.21 => 1.21.2.1 ===
--- Zope3/src/zope/app/traversing/namespace.py:1.21	Mon Oct  6 18:08:53 2003
+++ Zope3/src/zope/app/traversing/namespace.py	Sun Nov  9 11:08:29 2003
@@ -15,10 +15,8 @@
 $Id$
 """
 
+from zope.app import zapi
 from zope.exceptions import NotFoundError
-from zope.component import queryAdapter
-from zope.component import queryDefaultViewName, queryView, getService
-from zope.app.services.servicenames import Resources
 from zope.app.interfaces.traversing import ITraversable
 from zope.proxy import removeAllProxies
 import re
@@ -91,8 +89,8 @@
     return resource
 
 def queryResourceInContext(ob, name, request, default=None):
-    resource_service = getService(ob, Resources)
-    resource = resource_service.queryResource(ob, name, request)
+    resource_service = zapi.getService(ob, zapi.servicenames.Presentation)
+    resource = resource_service.queryResource(name, request)
     if resource is None:
         return default
 
@@ -116,7 +114,7 @@
     origOb = ob
     while i < 200:
         i += 1
-        traversable = queryAdapter(ob, ITraversable, None)
+        traversable = zapi.queryAdapter(ob, ITraversable, None)
         if traversable is not None:
 
             try:
@@ -181,14 +179,14 @@
 
 def help(name, parameters, pname, ob, request):
     """Used to traverse to an online help topic."""
-    return getService(ob, 'OnlineHelp')
+    return zapi.getService(ob, 'OnlineHelp')
 
 def view(name, parameters, pname, ob, request):
     if parameters:
         raise UnexpectedParameters(parameters)
     if not request:
         raise NoRequest(pname)
-    view = queryView(ob, name, request)
+    view = zapi.queryView(ob, name, request)
     if view is None:
         raise NotFoundError(ob, name)
 




More information about the Zope3-Checkins mailing list