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

Jim Fulton jim at zope.com
Fri Aug 8 15:07:38 EDT 2003


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

Modified Files:
	namespace.py 
Log Message:
In preparation for containergeddon, refactored away the use of
the side_effect_names in context wrappers to deal with path segments
with side effects.

Changed the skin namespace to call shiftNameToApplication.

Changed the virtual host handler to require a closing ++ path
element.


=== Zope3/src/zope/app/traversing/namespace.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/traversing/namespace.py:1.16	Sat Aug  2 14:17:25 2003
+++ Zope3/src/zope/app/traversing/namespace.py	Fri Aug  8 14:07:33 2003
@@ -59,19 +59,7 @@
         raise NotFoundError(name)
 
     new = handler(qname, parameters, name, object, request)
-    if new is object:
-        # The handler had a side effect only and didn't look up a
-        # different object.  We want to retain the side-effect name
-        # for things like URLs.
-
-        # We'll just at the name to the side-effect names stored in
-        # the object's wrapper.
-
-        data = getWrapperData(new, create=True)
-        data['side_effect_names'] = (data.get('side_effect_names', ())
-                                     + (name, )
-                                     )
-    else:
+    if new is not object:
         new = ContextWrapper(new, object, name=name)
 
     return new
@@ -224,7 +212,8 @@
     if not request:
         raise NoRequest(pname)
 
-    request.setViewSkin(name)
+    request.shiftNameToApplication()
+    request.setPresentationSkin(name)
 
     return ob
 
@@ -248,7 +237,9 @@
             app_names.append(segment)
             segment = traversal_stack.pop()
         request.setTraversalStack(traversal_stack)
+    else:
+        raise ValueError("Must have a path element '++' after a virtual host "
+                         "directive.")
 
-    request.setApplicationNames(app_names)
-    request.setVirtualHostRoot()
+    request.setVirtualHostRoot(app_names)
     return ob




More information about the Zope3-Checkins mailing list