[ZPT] CVS: Releases/Zope/lib/python/TAL - DummyEngine.py:1.32.6.5 ITALES.py:1.1.10.2 TALInterpreter.py:1.69.6.9
Evan Simpson
evan@zope.com
Wed, 9 Oct 2002 10:37:39 -0400
Update of /cvs-repository/Releases/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv19845/lib/python/TAL
Modified Files:
Tag: Zope-2_6-branch
DummyEngine.py ITALES.py TALInterpreter.py
Log Message:
Fix Collector #372 by having TALInterpreter fetch the expression compiler from the execution context when it parses
inserted structural text.
=== Releases/Zope/lib/python/TAL/DummyEngine.py 1.32.6.4 => 1.32.6.5 ===
--- Releases/Zope/lib/python/TAL/DummyEngine.py:1.32.6.4 Tue Oct 1 11:54:26 2002
+++ Releases/Zope/lib/python/TAL/DummyEngine.py Wed Oct 9 10:37:38 2002
@@ -62,6 +62,9 @@
def getCompilerError(self):
return CompilerError
+ def getCompiler(self):
+ return self
+
def setSourceFile(self, source_file):
self.source_file = source_file
=== Releases/Zope/lib/python/TAL/ITALES.py 1.1.10.1 => 1.1.10.2 ===
--- Releases/Zope/lib/python/TAL/ITALES.py:1.1.10.1 Wed Sep 18 10:54:13 2002
+++ Releases/Zope/lib/python/TAL/ITALES.py Wed Oct 9 10:37:38 2002
@@ -41,6 +41,9 @@
ITALESCompiler.compile().
"""
+ def getCompiler():
+ """Return an object that supports ITALESCompiler."""
+
def getDefault():
"""Return the value of the 'default' TALES expression.
=== Releases/Zope/lib/python/TAL/TALInterpreter.py 1.69.6.8 => 1.69.6.9 ===
--- Releases/Zope/lib/python/TAL/TALInterpreter.py:1.69.6.8 Wed Sep 25 11:59:39 2002
+++ Releases/Zope/lib/python/TAL/TALInterpreter.py Wed Oct 9 10:37:38 2002
@@ -594,7 +594,7 @@
def insertHTMLStructure(self, text, repldict):
from HTMLTALParser import HTMLTALParser
- gen = AltTALGenerator(repldict, self.engine, 0)
+ gen = AltTALGenerator(repldict, self.engine.getCompiler(), 0)
p = HTMLTALParser(gen) # Raises an exception if text is invalid
p.parseString(text)
program, macros = p.getCode()
@@ -602,7 +602,7 @@
def insertXMLStructure(self, text, repldict):
from TALParser import TALParser
- gen = AltTALGenerator(repldict, self.engine, 0)
+ gen = AltTALGenerator(repldict, self.engine.getCompiler(), 0)
p = TALParser(gen)
gen.enable(0)
p.parseFragment('<!DOCTYPE foo PUBLIC "foo" "bar"><foo>')