[ZPT] CVS: Packages/TAL - HTMLParser.py:1.11 TALGenerator.py:1.25 TALInterpreter.py:1.25

guido@digicool.com guido@digicool.com
Mon, 26 Mar 2001 11:49:03 -0500 (EST)


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

Modified Files:
	HTMLParser.py TALGenerator.py TALInterpreter.py 
Log Message:
Change in HTMLParser API: attributes without a value (e.g. <img
ismap>) pass None for the value instead of the attribute name.  This
is then used to generate the same output, rather than <img
ismap="ismap">).  Includes tests.




--- Updated File HTMLParser.py in package Packages/TAL --
--- HTMLParser.py	2001/03/26 16:21:52	1.10
+++ HTMLParser.py	2001/03/26 16:48:32	1.11
@@ -275,7 +275,7 @@
                 break
             attrname, rest, attrvalue = m.group(1, 2, 3)
             if not rest:
-                attrvalue = attrname
+                attrvalue = None
             elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
                  attrvalue[:1] == '"' == attrvalue[-1:]:
                 attrvalue = attrvalue[1:-1]

--- Updated File TALGenerator.py in package Packages/TAL --
--- TALGenerator.py	2001/03/23 21:35:49	1.24
+++ TALGenerator.py	2001/03/26 16:48:32	1.25
@@ -152,7 +152,10 @@
         for item in attrlist:
             if len(item) > 2:
                 return 0
-            new.append(" %s=%s" % (item[0], quote(item[1])))
+            if item[1] is None:
+                new.append(" %s" % item[0])
+            else:
+                new.append(" %s=%s" % (item[0], quote(item[1])))
         new.append(end)
         collect.extend(new)
         return 1

--- Updated File TALInterpreter.py in package Packages/TAL --
--- TALInterpreter.py	2001/03/23 21:35:49	1.24
+++ TALInterpreter.py	2001/03/26 16:48:32	1.25
@@ -209,6 +209,8 @@
             if (self.html and not value and
                 string.lower(name) in BOOLEAN_HTML_ATTRS):
                 s = name
+            elif value is None:
+                s = name
             else:
                 s = "%s=%s" % (name, quote(value))
             if (self.wrap and