[ZPT] CVS: Zope/lib/python/TAL - DummyEngine.py:1.28

Guido van Rossum guido@python.org
Wed, 17 Oct 2001 16:05:07 -0400


Update of /cvs-repository/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv31644

Modified Files:
	DummyEngine.py 
Log Message:
Add dummy versions (how appropriate :-) of the APIs getCompilerError()
and setPosition(), to make more of the tests succeed.


=== Zope/lib/python/TAL/DummyEngine.py 1.27 => 1.28 ===
 name_match = re.compile(r"(?s)(%s):(.*)\Z" % NAME_RE).match
 
+class CompilerError(Exception):
+    pass
+
 class DummyEngine:
 
+    position = None
+
     def __init__(self, macros=None):
         if macros is None:
             macros = {}
@@ -107,6 +112,12 @@
         dict = {'nothing': None, 'default': Default}
         self.locals = self.globals = dict
         self.stack = [dict]
+
+    def getCompilerError(self):
+        return CompilerError
+
+    def setPosition(self, position):
+        self.position = position
 
     def compile(self, expr):
         return "$%s$" % expr