- if (attrs.has_key('text')):
- attrlist[attrs.get('text', "")] = "foo"
- if (attrs.has_key('title')):
- attrlist[attrs.get('title', "")] = "foo"
- if (attrs.has_key('value')):
- attrlist[attrs.get('value', "")] = "foo"
- if (attrs.has_key('caption')):
- attrlist[attrs.get('caption', "")] = "foo"
+ for x in ["text", "title", "value", "caption"]:
+ try:
+ attrlist.add((attrs[x], self.last_comment))
+ self.last_comment = None
+ except KeyError:
+ pass