[ZPT] CVS: Packages/TAL - DummyEngine.py:1.22.2.1 TALInterpreter.py:1.39.2.2

evan@serenade.digicool.com evan@serenade.digicool.com
Mon, 14 May 2001 12:31:53 -0400


Update of /cvs-repository/Packages/TAL
In directory serenade:/home/evan/Zope/pt/lib/python/TAL

Modified Files:
      Tag: tal-1_2
	DummyEngine.py TALInterpreter.py 
Log Message:
Changed CancelAction to Default, and removed tests that made Default affect variable definition.



--- Updated File DummyEngine.py in package Packages/TAL --
--- DummyEngine.py	2001/04/27 18:12:16	1.22
+++ DummyEngine.py	2001/05/14 16:31:52	1.22.2.1
@@ -92,7 +92,7 @@
 
 from TALDefs import NAME_RE, TALError, TALESError
 
-CancelAction = []
+Default = []
 
 class DummyEngine:
 
@@ -122,12 +122,10 @@
         if self.locals is self.stack[-1]:
             # Unmerge this scope's locals from previous scope of first set
             self.locals = self.locals.copy()
-        if value is not CancelAction:
             self.locals[name] = value
 
     def setGlobal(self, name, value):
-        if value is not CancelAction:
-            self.globals[name] = value
+        self.globals[name] = value
 
     def evaluate(self, expression):
         expression = self.uncompile(expression)
@@ -225,8 +223,8 @@
     def getTALESError(self):
         return TALESError
 
-    def getCancelAction(self):
-        return CancelAction
+    def getDefault(self):
+        return Default
 
 class Iterator:
 

--- Updated File TALInterpreter.py in package Packages/TAL --
--- TALInterpreter.py	2001/05/08 21:26:43	1.39.2.1
+++ TALInterpreter.py	2001/05/14 16:31:52	1.39.2.2
@@ -157,7 +157,7 @@
         self.macros = macros
         self.engine = engine
         self.TALESError = engine.getTALESError()
-        self.CancelAction = engine.getCancelAction()
+        self.Default = engine.getDefault()
         self.stream = stream or sys.stdout
         self.debug = debug
         self.wrap = wrap
@@ -265,7 +265,7 @@
                 if action <= 1 and self.tal:
                     if self.html and string.lower(name) in BOOLEAN_HTML_ATTRS:
                         evalue = self.engine.evaluateBoolean(item[3])
-                        if evalue is self.CancelAction:
+                        if evalue is self.Default:
                             if action == 1: # Cancelled insert
                                 continue
                         elif not evalue:
@@ -274,7 +274,7 @@
                             value = None
                     else:
                         evalue = self.engine.evaluateText(item[3])
-                        if evalue is self.CancelAction:
+                        if evalue is self.Default:
                             if action == 1: # Cancelled insert
                                 continue
                         else:
@@ -329,7 +329,7 @@
         text = self.engine.evaluateText(expr)
         if text is None:
             return
-        if text is self.CancelAction:
+        if text is self.Default:
             self.interpret(block)
             return
         text = cgi.escape(text)
@@ -342,7 +342,7 @@
         structure = self.engine.evaluateStructure(expr)
         if structure is None:
             return
-        if structure is self.CancelAction:
+        if structure is self.Default:
             self.interpret(block)
             return
         text = str(structure)
@@ -399,7 +399,7 @@
             self.interpret(block)
             return
         macro = self.engine.evaluateMacro(macroExpr)
-        if macro is self.CancelAction:
+        if macro is self.Default:
             self.interpret(block)
             return
         if not isCurrentVersion(macro):