Beispiel #1
0
 def __unicode__(self):
     """
     Convert the element into an XML unicode string.
     """
     args = 'type="result"'
     if self.request:
         args += ' id="%s"' % self.request.get('id')
         if self.request.get('to') is not None:
             args += ' from="%s"' % self.request.get('to')
         if self.request.get('from') is not None:
             args += ' to="%s"' % self.request.get('from')
     if self.tagname is None:
         return u'<iq %s/>' % args
     return u'<iq %s>%s</iq>' % (args, Element.__unicode__(self))
Beispiel #2
0
 def __unicode__(self):
     """
     Convert the element into an XML unicode string.
     """
     args = 'type="error"'
     request = ''
     if self.request:
         args += ' id="%s"' % self.request.get('id')
         if self.request.get('to') is not None:
             args += ' from="%s"' % self.request.get('to')
         if self.request.get('from') is not None:
             args += ' to="%s"' % self.request.get('from')
         for child in self.request:
             request = unicode(child)
     return u'<iq %s>%s%s</iq>' % (args, request, Element.__unicode__(self))
Beispiel #3
0
 def __unicode__(self):
     """
     Convert the element into an XML unicode string.
     """
     return u'<message%s>%s</message>' % (self._routing, Element.__unicode__(self))
Beispiel #4
0
 def __unicode__(self):
     """
     Convert the element into an XML unicode string.
     """
     return u'<iq%s%s>%s</iq>' % (self._routing, self._attributes, Element.__unicode__(self))