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
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
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
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