[ZPT] CVS: Releases/Zope/lib/python/Products/PageTemplates - PythonExpr.py:1.11 TALES.py:1.36
Evan Simpson
evan@zope.com
Wed, 9 Oct 2002 10:40:34 -0400
Update of /cvs-repository/Releases/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv20619/lib/python/Products/PageTemplates
Modified Files:
PythonExpr.py TALES.py
Log Message:
Fix Collector #372
=== Releases/Zope/lib/python/Products/PageTemplates/PythonExpr.py 1.10 => 1.11 ===
--- Releases/Zope/lib/python/Products/PageTemplates/PythonExpr.py:1.10 Thu Sep 19 10:39:24 2002
+++ Releases/Zope/lib/python/Products/PageTemplates/PythonExpr.py Wed Oct 9 10:40:33 2002
@@ -47,7 +47,7 @@
# Bind template variables
names = {}
vars = econtext.vars
- getType = econtext._engine.getTypes().get
+ getType = econtext.getCompiler().getTypes().get
for vname in self._f_varnames:
val = vars.get(vname, _marker)
if val is _marker:
@@ -78,5 +78,5 @@
self._econtext = econtext
def __call__(self, text):
return self._handler(self._name, text,
- self._econtext._engine)(self._econtext)
+ self._econtext.getCompiler())(self._econtext)
=== Releases/Zope/lib/python/Products/PageTemplates/TALES.py 1.35 => 1.36 ===
--- Releases/Zope/lib/python/Products/PageTemplates/TALES.py:1.35 Wed Sep 25 20:29:54 2002
+++ Releases/Zope/lib/python/Products/PageTemplates/TALES.py Wed Oct 9 10:40:33 2002
@@ -152,8 +152,8 @@
position = (None, None)
source_file = None
- def __init__(self, engine, contexts):
- self._engine = engine
+ def __init__(self, compiler, contexts):
+ self._compiler = compiler
self.contexts = contexts
contexts['nothing'] = None
contexts['default'] = Default
@@ -170,6 +170,9 @@
# Keep track of what needs to be popped as each scope ends.
self._scope_stack = []
+ def getCompiler(self):
+ return self._compiler
+
def beginScope(self):
self._scope_stack.append([self.local_vars.copy()])
@@ -198,8 +201,8 @@
def setRepeat(self, name, expr):
expr = self.evaluate(expr)
if not expr:
- return self._engine.Iterator(name, (), self)
- it = self._engine.Iterator(name, expr, self)
+ return self._compiler.Iterator(name, (), self)
+ it = self._compiler.Iterator(name, expr, self)
old_value = self.repeat_vars.get(name)
self._scope_stack[-1].append((name, old_value))
self.repeat_vars[name] = it
@@ -208,7 +211,7 @@
def evaluate(self, expression,
isinstance=isinstance, StringType=StringType):
if isinstance(expression, StringType):
- expression = self._engine.compile(expression)
+ expression = self._compiler.compile(expression)
__traceback_supplement__ = (
TALESTracebackSupplement, self, expression)
return expression(self)