Commit 45c3d978 authored by Guido van Rossum's avatar Guido van Rossum

Allow tal:attributes to create brand new attributes.

parent 5eb21653
...@@ -253,11 +253,15 @@ class TALParser(XMLParser): ...@@ -253,11 +253,15 @@ class TALParser(XMLParser):
key = self.fixname(fullkey) key = self.fixname(fullkey)
if repldict.has_key(key): if repldict.has_key(key):
item = (key, value, "replace", repldict[key]) item = (key, value, "replace", repldict[key])
del repldict[key]
elif fullkey == METAL_DEFINE_MACRO: elif fullkey == METAL_DEFINE_MACRO:
item = (key, value, "macroHack") item = (key, value, "macroHack")
else: else:
item = (key, value) item = (key, value)
newlist.append(item) newlist.append(item)
for key, value in repldict.items(): # Add dynamic-only attributes
item = (key, "", "replace", value)
newlist.append(item)
return newlist return newlist
def fixname(self, name): def fixname(self, name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment