[Checkins] SVN: five.pt/trunk/ Adjusted the path expression to provide the full namespace to the render function and not just the request. This matches Zope2 behavior.

Hanno Schlichting plone at hannosch.info
Sat Nov 29 07:36:03 EST 2008


Log message for revision 93444:
  Adjusted the path expression to provide the full namespace to the render function and not just the request. This matches Zope2 behavior.
  

Changed:
  U   five.pt/trunk/CHANGES.txt
  U   five.pt/trunk/src/five/pt/expressions.py

-=-
Modified: five.pt/trunk/CHANGES.txt
===================================================================
--- five.pt/trunk/CHANGES.txt	2008-11-29 12:33:01 UTC (rev 93443)
+++ five.pt/trunk/CHANGES.txt	2008-11-29 12:36:03 UTC (rev 93444)
@@ -4,6 +4,9 @@
 HEAD
 ----
 
+- Adjusted the path expression to provide the full namespace to the render
+  function and not just the request. This matches Zope2 behavior. [hannosch]
+
 five.pt 0.2 (released 11/29/2008)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Modified: five.pt/trunk/src/five/pt/expressions.py
===================================================================
--- five.pt/trunk/src/five/pt/expressions.py	2008-11-29 12:33:01 UTC (rev 93443)
+++ five.pt/trunk/src/five/pt/expressions.py	2008-11-29 12:36:03 UTC (rev 93444)
@@ -22,11 +22,9 @@
     AQ_WRAP_CP = False
     
 class FiveTraverser(object):
-    def __call__(self, base, request, call, *path_items):
+    def __call__(self, base, scope, call, *path_items):
         """See ``zope.app.pagetemplate.engine``."""
 
-        ob = base
-        
         length = len(path_items)
         if length:
             i = 0
@@ -43,7 +41,7 @@
                         base = base[name]
                     else:
                         base = traversePathElement(
-                            base, name, path_items[i:], request=request)
+                            base, name, path_items[i:], request=scope['request'])
 
         if call is False:
             return base
@@ -51,12 +49,13 @@
         if getattr(base, '__call__', _marker) is not _marker or callable(base):
             # here's where we're different from the standard path
             # traverser
-            base = render(base, ob)
+            base = render(base, scope)
 
         return base
 
 class PathTranslator(PathTranslator):
     path_traverse = FiveTraverser()
+    scope = 'locals()'
 
 class FiveExistsTraverser(ZopeExistsTraverser):
     exceptions = AttributeError, LookupError, TypeError, \



More information about the Checkins mailing list