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


Python Iq.get_id方法代码示例

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


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

示例1: configure_room

# 需要导入模块: from pyxmpp.iq import Iq [as 别名]
# 或者: from pyxmpp.iq.Iq import get_id [as 别名]
    def configure_room(self, form):
        """
        Configure the room using the provided data.
        Do nothing if the provided form is of type 'cancel'.

        :Parameters:
            - `form`: the configuration parameters. Should be a 'submit' form made by filling-in
              the configuration form retireved using `self.request_configuration_form` or
              a 'cancel' form.
        :Types:
            - `form`: `Form`

        :return: id of the request stanza or `None` if a 'cancel' form was provieded.
        :returntype: `unicode`
        """

        if form.type == "cancel":
            return None
        elif form.type != "submit":
            raise ValueError, "A 'submit' form required to configure a room"
        iq = Iq(to_jid = self.room_jid.bare(), stanza_type = "set")
        query = iq.new_query(MUC_OWNER_NS, "query")
        form.as_xml(query)
        self.manager.stream.set_response_handlers(
                iq, self.process_configuration_success, self.process_configuration_error)
        self.manager.stream.send(iq)
        return iq.get_id()
开发者ID:AdamPrzybyla,项目名称:pyxmpp,代码行数:29,代码来源:muc.py

示例2: request_configuration_form

# 需要导入模块: from pyxmpp.iq import Iq [as 别名]
# 或者: from pyxmpp.iq.Iq import get_id [as 别名]
    def request_configuration_form(self):
        """
        Request a configuration form for the room.

        When the form is received `self.handler.configuration_form_received` will be called.
        When an error response is received then `self.handler.error` will be called.

        :return: id of the request stanza.
        :returntype: `unicode`
        """
        iq = Iq(to_jid = self.room_jid.bare(), stanza_type = "get")
        iq.new_query(MUC_OWNER_NS, "query")
        self.manager.stream.set_response_handlers(
                iq, self.process_configuration_form_success, self.process_configuration_form_error)
        self.manager.stream.send(iq)
        return iq.get_id()
开发者ID:AdamPrzybyla,项目名称:pyxmpp,代码行数:18,代码来源:muc.py


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