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


Python ircmsgs.ping函数代码示例

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


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

示例1: testHashing

    def testHashing(self):
        msg = ircmsgs.ping('0')
        irc = irclib.Irc('test')
        proxy = callbacks.SimpleProxy(irc, msg)
        # First one way...
        self.failIf(proxy != irc)
        self.failUnless(proxy == irc)
        self.assertEqual(hash(proxy), hash(irc))
        # Then the other!
        self.failIf(irc != proxy)
        self.failUnless(irc == proxy)
        self.assertEqual(hash(irc), hash(proxy))

        # And now dictionaries...
        d = {}
        d[irc] = 'foo'
        self.failUnless(len(d) == 1)
        self.failUnless(d[irc] == 'foo')
        self.failUnless(d[proxy] == 'foo')
        d[proxy] = 'bar'
        self.failUnless(len(d) == 1)
        self.failUnless(d[irc] == 'bar')
        self.failUnless(d[proxy] == 'bar')
        d[irc] = 'foo'
        self.failUnless(len(d) == 1)
        self.failUnless(d[irc] == 'foo')
        self.failUnless(d[proxy] == 'foo')
开发者ID:AssetsIncorporated,项目名称:Limnoria,代码行数:27,代码来源:test_callbacks.py

示例2: _addIrc

 def _addIrc(self, irc):
     # Let's just be extra-special-careful here.
     if irc not in self.ircstates:
         self.ircstates[irc] = irclib.IrcState()
     if irc not in self.lastmsg:
         self.lastmsg[irc] = ircmsgs.ping('this is just a fake message')
     if not world.testing:
         for channel in irc.state.channels:
             irc.queueMsg(ircmsgs.who(channel))
             irc.queueMsg(ircmsgs.names(channel))
开发者ID:bnrubin,项目名称:supybot_fixes,代码行数:10,代码来源:plugin.py

示例3: latency

    def latency(self, irc, msg, args, otherIrc):
        """[<network>]

        Returns the current latency to <network>.  <network> is only necessary
        if the message isn't sent on the network to which this command is to
        apply.
        """
        otherIrc.queueMsg(ircmsgs.ping(_("Latency check (from %s).") % msg.nick))
        self._latency[otherIrc] = (irc, time.time())
        irc.noReply()
开发者ID:carriercomm,项目名称:Limnoria,代码行数:10,代码来源:plugin.py

示例4: pin

    def pin(self, irc, msg, args, name):
        """<name>

        PINGS <name> and return reply"""
        v = irc.queueMsg(ircmsgs.ping(name))
        irc.reply(v)
        m = conf.supybot.directories.plugins
        irc.reply(m)
        k = sys.modules[name]
        irc.reply(k)
开发者ID:kg-bot,项目名称:SupyBot,代码行数:10,代码来源:plugin.py

示例5: __call__

 def __call__(self, irc, msg):
     if irc not in self.ircstates:
         self.ircstates[irc] = irclib.IrcState()
     try:
         self.ircstates[irc].addMsg(irc, self.lastmsg[irc])
     except KeyError:
         self.ircstates[irc].addMsg(irc,
                                    ircmsgs.ping("placeholder message"))
     finally:
         self.lastmsg[irc] = msg
     self.__parent.__call__(irc, msg)
开发者ID:gbyers,项目名称:SupyPlugins,代码行数:11,代码来源:plugin.py

示例6: _addIrc

 def _addIrc(self, irc):
     # Let's just be extra-special-careful here.
     if irc not in self.ircstates:
         self.ircstates[irc] = irclib.IrcState()
     if irc not in self.lastmsg:
         self.lastmsg[irc] = ircmsgs.ping('this is just a fake message')
     if irc.afterConnect:
         # We've probably been reloaded.  Let's send some messages to get
         # our IrcState objects up to current.
         for channel in self.registryValue('channels'):
             irc.queueMsg(ircmsgs.who(channel))
             irc.queueMsg(ircmsgs.names(channel))
开发者ID:GlitterCakes,项目名称:PoohBot,代码行数:12,代码来源:plugin.py

示例7: testPingResponse

 def testPingResponse(self):
     self.irc.feedMsg(ircmsgs.ping('123'))
     self.assertEqual(ircmsgs.pong('123'), self.irc.takeMsg())
开发者ID:krattai,项目名称:AEBL,代码行数:3,代码来源:test_irclib.py


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