[ZPT] CVS: Packages/TAL - TALGenerator.py:1.51

Evan Simpson evan@zope.com
Tue, 2 Oct 2001 13:38:14 -0400


Update of /cvs-repository/Packages/TAL
In directory cvs.zope.org:/tmp/cvs-serv21282

Modified Files:
	TALGenerator.py 
Log Message:
Raise error on missing TAL and METAL attribute values.


=== Packages/TAL/TALGenerator.py 1.50 => 1.51 ===
             return
 
-        for key in taldict.keys():
+        for key, value in taldict.items():
             if key not in KNOWN_TAL_ATTRIBUTES:
                 raise TALError("bad TAL attribute: " + `key`, position)
-        for key in metaldict.keys():
+            if not (value or key == 'omit-tag'):
+                raise TALError("missing value for TAL attribute: " +
+                               `key`, position)
+        for key, value in metaldict.items():
             if key not in KNOWN_METAL_ATTRIBUTES:
-                raise METALError("bad METAL attribute: " + `key`, position)
+                raise METALError("bad METAL attribute: " + `key`,
+                position)
+            if not value:
+                raise TALError("missing value for METAL attribute: " +
+                               `key`, position)
         todo = {}
         defineMacro = metaldict.get("define-macro")
         useMacro = metaldict.get("use-macro")