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


Python xmlstream.register_stanza_plugin函数代码示例

本文整理汇总了Python中slixmpp.xmlstream.register_stanza_plugin函数的典型用法代码示例。如果您正苦于以下问题:Python register_stanza_plugin函数的具体用法?Python register_stanza_plugin怎么用?Python register_stanza_plugin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: plugin_init

    def plugin_init(self):
        self.xmpp.namespace_map['http://www.google.com/talk/protocol/auth'] = 'ga'

        register_stanza_plugin(self.xmpp['feature_mechanisms'].stanza.Auth,
                               stanza.GoogleAuth)

        self.xmpp.add_filter('out', self._auth)
开发者ID:mathieui,项目名称:slixmpp,代码行数:7,代码来源:auth.py

示例2: plugin_init

    def plugin_init(self):
        self.xmpp.register_handler(
            Callback('Explicit Message Encryption',
                     StanzaPath('message/eme'),
                     self._handle_eme))

        register_stanza_plugin(Message, Encryption)
开发者ID:mathieui,项目名称:slixmpp,代码行数:7,代码来源:eme.py

示例3: plugin_init

    def plugin_init(self):
        """
        Start the XEP-0030 plugin.
        """
        self.xmpp.register_handler(
                Callback('Disco Info',
                         StanzaPath('iq/disco_info'),
                         self._handle_disco_info))

        self.xmpp.register_handler(
                Callback('Disco Items',
                         StanzaPath('iq/disco_items'),
                         self._handle_disco_items))

        register_stanza_plugin(Iq, DiscoInfo)
        register_stanza_plugin(Iq, DiscoItems)

        self.static = StaticDisco(self.xmpp, self)

        self._disco_ops = [
                'get_info', 'set_info', 'set_identities', 'set_features',
                'get_items', 'set_items', 'del_items', 'add_identity',
                'del_identity', 'add_feature', 'del_feature', 'add_item',
                'del_item', 'del_identities', 'del_features', 'cache_info',
                'get_cached_info', 'supports', 'has_identity']

        for op in self._disco_ops:
            self.api.register(getattr(self.static, op), op, default=True)
开发者ID:goutomroy,项目名称:slixmpp,代码行数:28,代码来源:disco.py

示例4: testPublishSingle

    def testPublishSingle(self):
        """Test publishing a single item."""
        payload = AtomEntry()
        payload['title'] = 'Test'

        register_stanza_plugin(self.xmpp['xep_0060'].stanza.Item, AtomEntry)

        self.xmpp['xep_0060'].publish(
            'pubsub.example.com',
            'somenode',
            id='id42',
            payload=payload)
        self.send("""
          <iq type="set" id="1" to="pubsub.example.com">
            <pubsub xmlns="http://jabber.org/protocol/pubsub">
              <publish node="somenode">
                <item id="id42">
                  <entry xmlns="http://www.w3.org/2005/Atom">
                    <title>Test</title>
                  </entry>
                </item>
              </publish>
            </pubsub>
          </iq>
        """, use_values=False)
开发者ID:budlight,项目名称:slixmpp,代码行数:25,代码来源:test_stream_xep_0060.py

示例5: plugin_init

    def plugin_init(self):
        register_stanza_plugin(Presence, LastActivity)

        self.xmpp.add_filter('out', self._initial_presence_activity)
        self.xmpp.add_event_handler('connected', self._reset_presence_activity)

        self._initial_presence = set()
开发者ID:mathieui,项目名称:slixmpp,代码行数:7,代码来源:xep_0256.py

示例6: plugin_init

    def plugin_init(self):
        register_stanza_plugin(Iq, stanza.UserSettings)

        self.xmpp.register_handler(
                Callback('Google Settings',
                    StanzaPath('[email protected]=set/google_settings'),
                    self._handle_settings_change))
开发者ID:budlight,项目名称:slixmpp,代码行数:7,代码来源:settings.py

示例7: plugin_init

    def plugin_init(self):
        self.xmpp.register_feature('preapproval',
                self._handle_preapproval,
                restart=False,
                order=9001)

        register_stanza_plugin(StreamFeatures, stanza.PreApproval)
开发者ID:budlight,项目名称:slixmpp,代码行数:7,代码来源:preapproval.py

示例8: plugin_init

 def plugin_init(self):
     self._idle_stamps = {}
     register_stanza_plugin(Presence, stanza.Idle)
     self.api.register(self._set_idle, "set_idle", default=True)
     self.api.register(self._get_idle, "get_idle", default=True)
     self.xmpp.register_handler(Callback("Idle Presence", StanzaPath("presence/idle"), self._idle_presence))
     self.xmpp.add_filter("out", self._stamp_idle_presence)
开发者ID:poezio,项目名称:slixmpp,代码行数:7,代码来源:idle.py

示例9: plugin_init

    def plugin_init(self):
        register_stanza_plugin(self.xmpp['xep_0060'].stanza.Item, Bookmarks)

        self.xmpp['xep_0049'].register(Bookmarks)
        self.xmpp['xep_0163'].register_pep('bookmarks', Bookmarks)

        self.xmpp.add_event_handler('session_start', self._autojoin)
开发者ID:budlight,项目名称:slixmpp,代码行数:7,代码来源:bookmarks.py

示例10: plugin_init

    def plugin_init(self):
        self.xmpp.register_handler(
                Callback('Direct MUC Invitations',
                         StanzaPath('message/groupchat_invite'),
                         self._handle_invite))

        register_stanza_plugin(Message, Invite)
开发者ID:mathieui,项目名称:slixmpp,代码行数:7,代码来源:invite.py

示例11: plugin_init

    def plugin_init(self):
        self.xmpp.register_feature('rosterver',
                self._handle_rosterver,
                restart=False,
                order=9000)

        register_stanza_plugin(StreamFeatures, stanza.RosterVer)
开发者ID:budlight,项目名称:slixmpp,代码行数:7,代码来源:rosterver.py

示例12: plugin_init

    def plugin_init(self):
        self.gpg = GPG(gnupghome=self.gpg_home,
                       gpgbinary=self.gpg_binary,
                       use_agent=self.use_agent,
                       keyring=self.keyring)

        self.xmpp.add_filter('out', self._sign_presence)

        self._keyids = {}

        self.api.register(self._set_keyid, 'set_keyid', default=True)
        self.api.register(self._get_keyid, 'get_keyid', default=True)
        self.api.register(self._del_keyid, 'del_keyid', default=True)
        self.api.register(self._get_keyids, 'get_keyids', default=True)

        register_stanza_plugin(Presence, Signed)
        register_stanza_plugin(Message, Encrypted)

        self.xmpp.add_event_handler('unverified_signed_presence',
                self._handle_unverified_signed_presence)

        self.xmpp.register_handler(
                Callback('Signed Presence',
                    StanzaPath('presence/signed'),
                    self._handle_signed_presence))

        self.xmpp.register_handler(
                Callback('Encrypted Message',
                    StanzaPath('message/encrypted'),
                    self._handle_encrypted_message))
开发者ID:budlight,项目名称:slixmpp,代码行数:30,代码来源:gpg.py

示例13: plugin_init

    def plugin_init(self):
        """Start the XEP-0224 plugin."""
        register_stanza_plugin(Message, stanza.Attention)

        self.xmpp.register_handler(
                Callback('Attention',
                    StanzaPath('message/attention'),
                    self._handle_attention))
开发者ID:mathieui,项目名称:slixmpp,代码行数:8,代码来源:attention.py

示例14: plugin_init

    def plugin_init(self):
        register_stanza_plugin(Message, stanza.NoSave)
        register_stanza_plugin(Iq, stanza.NoSaveQuery)

        self.xmpp.register_handler(
                Callback('Google Nosave',
                    StanzaPath('[email protected]=set/google_nosave'),
                    self._handle_nosave_change))
开发者ID:mathieui,项目名称:slixmpp,代码行数:8,代码来源:nosave.py

示例15: plugin_init

    def plugin_init(self):
        self.xmpp.register_handler(
            Callback('Message Correction',
                     StanzaPath('message/replace'),
                     self._handle_correction))

        register_stanza_plugin(Message, Replace)

        self.xmpp.use_message_ids = True
开发者ID:budlight,项目名称:slixmpp,代码行数:9,代码来源:correction.py


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