def begin_tag(self, tag, props=None):
        s = ''
        if isinstance(props, dict):
            s = ''.join( ' %s="%s"' % (enc(k), enc(str(v))) for (k,v)
                         in sorted(props.iteritems()) )
        self.outfp.write('<%s%s>' % (enc(tag.name), s))
        self._stack.append(tag)
        return
dataset/ETHPy150Open clips/pattern/pattern/web/pdf/pdfdevice.py/TagExtractor.begin_tag/original