当前位置: 首页>>代码示例>>Python>>正文


Python Iq.set_content方法代码示例

本文整理汇总了Python中pyxmpp.iq.Iq.set_content方法的典型用法代码示例。如果您正苦于以下问题:Python Iq.set_content方法的具体用法?Python Iq.set_content怎么用?Python Iq.set_content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyxmpp.iq.Iq的用法示例。


在下文中一共展示了Iq.set_content方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _post_connect

# 需要导入模块: from pyxmpp.iq import Iq [as 别名]
# 或者: from pyxmpp.iq.Iq import set_content [as 别名]
 def _post_connect(self):
     """Initialize authentication when the connection is established
     and we are the initiator."""
     if not self.initiator:
         if "plain" in self.auth_methods or "digest" in self.auth_methods:
             self.set_iq_get_handler("query","jabber:iq:auth",
                         self.auth_in_stage1)
             self.set_iq_set_handler("query","jabber:iq:auth",
                         self.auth_in_stage2)
     elif self.registration_callback:
         iq = Iq(stanza_type = "get")
         iq.set_content(Register())
         self.set_response_handlers(iq, self.registration_form_received, self.registration_error)
         self.send(iq)
         return
     ClientStream._post_connect(self)
开发者ID:AlexUlrich,项目名称:digsby,代码行数:18,代码来源:clientstream.py

示例2: submit_registration_form

# 需要导入模块: from pyxmpp.iq import Iq [as 别名]
# 或者: from pyxmpp.iq.Iq import set_content [as 别名]
    def submit_registration_form(self, form):
        """Submit a registration form.

        [client only]

        :Parameters:
            - `form`: the filled-in form. When form is `None` or its type is
              "cancel" the registration is to be canceled.

        :Types:
            - `form`: `pyxmpp.jabber.dataforms.Form`"""
        self.lock.acquire()
        try:
            if form and form.type!="cancel":
                self.registration_form = form
                iq = Iq(stanza_type = "set")
                iq.set_content(self.__register.submit_form(form))
                self.set_response_handlers(iq, self.registration_success, self.registration_error)
                self.send(iq)
            else:
                self.__register = None
        finally:
            self.lock.release()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:25,代码来源:clientstream.py


注:本文中的pyxmpp.iq.Iq.set_content方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。