Ejemplo n.º 1
0
    def startElementNS(self, name, qname, attrs):
        self._write(text_type('<' + self.makeName(name)))

        for pair in self._undeclared_ns_maps:
            self._write(text_type(' xmlns:%s="%s"' % pair))
        self._undeclared_ns_maps = []

        for (name, value) in attrs.items():
            self._write(text_type(' %s=%s' % (self.makeName(name), quoteattr(value))))
        self._write(text_type('>'))
Ejemplo n.º 2
0
    def startElementNS(self, name, qname, attrs):
        self._write(text_type('<' + self.makeName(name)))

        for pair in self._undeclared_ns_maps:
            self._write(text_type(' xmlns:%s="%s"' % pair))
        self._undeclared_ns_maps = []

        for (name, value) in attrs.items():
            self._write(
                text_type(' %s=%s' % (self.makeName(name), quoteattr(value))))
        self._write(text_type('>'))
Ejemplo n.º 3
0
 def __str__(self):
     text = u''
     for x in self._dir:
         # "six.text_type" is unicode in Python 2 and str in Python 3.
         text += text_type(x)
     return ' '.join(text.split())
Ejemplo n.º 4
0
 def __str__(self):
     text = u""
     for x in self._dir:
         # "six.text_type" is unicode in Python 2 and str in Python 3.
         text += text_type(x)
     return " ".join(text.split())