Edgewall Software

Changeset 495 for trunk/genshi/input.py


Ignore:
Timestamp:
Feb 21, 2007, 10:51:43 AM (17 years ago)
Author:
cmlenz
Message:

Remove some magic/overhead from Attrs creation and manipulation by not automatically wrapping attribute names in QName.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/genshi/input.py

    r460 r495  
    183183
    184184    def _handle_start(self, tag, attrib):
    185         self._enqueue(START, (QName(tag), Attrs(zip(*[iter(attrib)] * 2))))
     185        attrs = Attrs([(QName(name), value) for name, value in
     186                       zip(*[iter(attrib)] * 2)])
     187        self._enqueue(START, (QName(tag), attrs))
    186188
    187189    def _handle_end(self, tag):
     
    316318            elif not isinstance(value, unicode):
    317319                value = value.decode(self.encoding, 'replace')
    318             fixed_attrib.append((name, stripentities(value)))
     320            fixed_attrib.append((QName(name), stripentities(value)))
    319321
    320322        self._enqueue(START, (QName(tag), Attrs(fixed_attrib)))
Note: See TracChangeset for help on using the changeset viewer.