示例#1
0
    def to_profile_element(e):
        p = E(u'profile', namespace=XMPP_USER_PROFILE_NS)

        if e.x:
            Data.to_element(e.x, parent=p)

        return p
示例#2
0
    def to_element(e):
        iq = Entity.to_element(e)
        p = E(u'profile', namespace=XMPP_USER_PROFILE_NS, parent=iq)

        if e.x:
            Data.to_element(e.x, parent=p)

        return iq
示例#3
0
    def to_element(e):
        iq = Entity.to_element(e)
        query = E(u'query', namespace=XMPP_IBR_NS, parent=iq)
        
        if e.remove:
            E(u'remove', namespace=XMPP_IBR_NS, parent=query)
        
        if e.registered:
            E(u'registered', namespace=XMPP_IBR_NS, parent=query)

        for info in e.infos:
           E(info, namespace=XMPP_IBR_NS, parent=query,
             content=e.infos[info]) 

        if e.x:
            Data.to_element(e.x, parent=query)

        return iq
示例#4
0
 def to_element(e, parent=None):
     c = E(u'configure', namespace=XMPP_PUBSUB_NS, parent=parent)
     Data.to_element(e.x, parent=c)
     return c