Commit 3a4c60ef authored by Evan Simpson's avatar Evan Simpson

Resync with changed implementation of 'item' in ZTUtils.Iterator.

parent 9850e579
...@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers ...@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths. for Python expressions, string literals, and paths.
""" """
__version__='$Revision: 1.28 $'[11:-2] __version__='$Revision: 1.29 $'[11:-2]
import re, sys import re, sys
from TALES import Engine, CompilerError, _valid_name, NAME_RE, \ from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
...@@ -25,6 +25,7 @@ from TALES import Engine, CompilerError, _valid_name, NAME_RE, \ ...@@ -25,6 +25,7 @@ from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
from string import strip, split, join, replace, lstrip from string import strip, split, join, replace, lstrip
from Acquisition import aq_base, aq_inner, aq_parent from Acquisition import aq_base, aq_inner, aq_parent
_engine = None _engine = None
def getEngine(): def getEngine():
global _engine global _engine
...@@ -254,11 +255,10 @@ def restrictedTraverse(self, path, securityManager, ...@@ -254,11 +255,10 @@ def restrictedTraverse(self, path, securityManager,
raise Unauthorized, name raise Unauthorized, name
i = 1 i = 1
plen = len(path)
REQUEST={'TraversalRequestNameStack': path} REQUEST={'TraversalRequestNameStack': path}
validate = securityManager.validate validate = securityManager.validate
object = self object = self
while i < plen: while i < len(path):
__traceback_info__ = (path, i) __traceback_info__ = (path, i)
name = path[i] name = path[i]
i = i + 1 i = i + 1
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
An implementation of a generic TALES engine An implementation of a generic TALES engine
""" """
__version__='$Revision: 1.26 $'[11:-2] __version__='$Revision: 1.27 $'[11:-2]
import re, sys, ZTUtils import re, sys, ZTUtils
from MultiMapping import MultiMapping from MultiMapping import MultiMapping
...@@ -109,7 +109,7 @@ class Iterator(ZTUtils.Iterator): ...@@ -109,7 +109,7 @@ class Iterator(ZTUtils.Iterator):
def next(self): def next(self):
try: try:
if ZTUtils.Iterator.next(self): if ZTUtils.Iterator.next(self):
self._context.setLocal(self.name, self.item()) self._context.setLocal(self.name, self.item)
return 1 return 1
except TALESError: except TALESError:
raise raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment