[Zpt] CVS: Packages/TAL - TALGenerator.py:1.7

fred@digiciool.com fred@digiciool.com
Wed, 14 Mar 2001 10:52:43 -0500 (EST)


Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv4515

Modified Files:
	TALGenerator.py 
Log Message:

Split .emitText() into .exitText() and .emitRawText(); both generate
"rawtext" instructions, but .emitText() re-writes the data to use magic
entities for HTML.  Adjacent "rawtext" instructions are collapsed into a
single instruction.



--- Updated File TALGenerator.py in package Packages/TAL --
--- TALGenerator.py	2001/02/14 20:19:17	1.6
+++ TALGenerator.py	2001/03/14 15:52:43	1.7
@@ -142,13 +142,15 @@
         else:
             self.program.append(("endTag", name))
 
-    def emitText(self, text):
-        text = cgi.escape(text)
+    def emitRawText(self, text):
         if self.program and self.program[-1][0] == "rawtext":
             # Concatenate text
             self.program[-1] = ("rawtext", self.program[-1][1] + text)
             return
         self.program.append(("rawtext", text))
+
+    def emitText(self, text):
+        self.emitRawText(cgi.escape(text))
 
     def emitDefines(self, defines):
         for part in splitParts(defines):