コード例 #1
0
ファイル: test_irclib.py プロジェクト: krattai/AEBL
 def testJoin(self):
     st = irclib.IrcState()
     st.addMsg(self.irc, ircmsgs.join('#foo', prefix=self.irc.prefix))
     self.failUnless('#foo' in st.channels)
     self.failUnless(self.irc.nick in st.channels['#foo'].users)
     st.addMsg(self.irc, ircmsgs.join('#foo', prefix='foo!bar@baz'))
     self.failUnless('foo' in st.channels['#foo'].users)
     st2 = st.copy()
     st.addMsg(self.irc, ircmsgs.quit(prefix='foo!bar@baz'))
     self.failIf('foo' in st.channels['#foo'].users)
     self.failUnless('foo' in st2.channels['#foo'].users)
コード例 #2
0
 def testJoin(self):
     st = irclib.IrcState()
     st.addMsg(self.irc, ircmsgs.join('#foo', prefix=self.irc.prefix))
     self.failUnless('#foo' in st.channels)
     self.failUnless(self.irc.nick in st.channels['#foo'].users)
     st.addMsg(self.irc, ircmsgs.join('#foo', prefix='foo!bar@baz'))
     self.failUnless('foo' in st.channels['#foo'].users)
     st2 = st.copy()
     st.addMsg(self.irc, ircmsgs.quit(prefix='foo!bar@baz'))
     self.failIf('foo' in st.channels['#foo'].users)
     self.failUnless('foo' in st2.channels['#foo'].users)
コード例 #3
0
ファイル: plugin.py プロジェクト: kblin/supybot-gsoc
    def quit(self, irc, msg, args, text):
        """[<text>]

        Exits the bot with the QUIT message <text>.  If <text> is not given,
        the default quit message (supybot.plugins.Owner.quitMsg) will be used.
        If there is no default quitMsg set, your nick will be used.
        """
        text = text or self.registryValue('quitMsg') or msg.nick
        irc.noReply()
        m = ircmsgs.quit(text)
        world.upkeep()
        for irc in world.ircs[:]:
            irc.queueMsg(m)
            irc.die()
コード例 #4
0
ファイル: plugin.py プロジェクト: kleopatra999/supybot
    def reconnect(self, irc, msg, args, otherIrc, quitMsg):
        """[<network>] [<quit message>]

        Disconnects and then reconnects to <network>.  If no network is given,
        disconnects and then reconnects to the network the command was given
        on.  If no quit message is given, uses the configured one
        (supybot.plugins.Owner.quitMsg) or the nick of the person giving the
        command.
        """
        quitMsg = quitMsg or conf.supybot.plugins.Owner.quitMsg() or msg.nick
        otherIrc.queueMsg(ircmsgs.quit(quitMsg))
        if otherIrc != irc:
            # No need to reply if we're reconnecting ourselves.
            irc.replySuccess()
コード例 #5
0
ファイル: plugin.py プロジェクト: TingPing/Limnoria
    def reconnect(self, irc, msg, args, otherIrc, quitMsg):
        """[<network>] [<quit message>]

        Disconnects and then reconnects to <network>.  If no network is given,
        disconnects and then reconnects to the network the command was given
        on.  If no quit message is given, uses the configured one
        (supybot.plugins.Owner.quitMsg) or the nick of the person giving the
        command.
        """
        quitMsg = quitMsg or conf.supybot.plugins.Owner.quitMsg() or msg.nick
        otherIrc.queueMsg(ircmsgs.quit(quitMsg))
        if otherIrc != irc:
            # No need to reply if we're reconnecting ourselves.
            irc.replySuccess()
コード例 #6
0
ファイル: plugin.py プロジェクト: kytvi2p/Limnoria
    def disconnect(self, irc, msg, args, otherIrc, quitMsg):
        """[<network>] [<quit message>]

        Disconnects from the network represented by the network <network>.
        If <quit message> is given, quits the network with the given quit
        message.  <network> is only necessary if the network is different
        from the network the command is sent on.
        """
        quitMsg = quitMsg or conf.supybot.plugins.Owner.quitMsg() or msg.nick
        otherIrc.queueMsg(ircmsgs.quit(quitMsg))
        otherIrc.die()
        conf.supybot.networks().discard(otherIrc.network)
        if otherIrc != irc:
            irc.replySuccess(_("Disconnection to %s initiated.") % otherIrc.network)
コード例 #7
0
ファイル: plugin.py プロジェクト: boamaod/Limnoria
    def quit(self, irc, msg, args, text):
        """[<text>]

        Exits the bot with the QUIT message <text>.  If <text> is not given,
        the default quit message (supybot.plugins.Owner.quitMsg) will be used.
        If there is no default quitMsg set, your nick will be used.
        """
        text = text or self.registryValue('quitMsg') or msg.nick
        irc.noReply()
        m = ircmsgs.quit(text)
        world.upkeep()
        for irc in world.ircs[:]:
            irc.queueMsg(m)
            irc.die()
コード例 #8
0
ファイル: plugin.py プロジェクト: kleopatra999/supybot
    def disconnect(self, irc, msg, args, otherIrc, quitMsg):
        """[<network>] [<quit message>]

        Disconnects from the network represented by the network <network>.
        If <quit message> is given, quits the network with the given quit
        message.  <network> is only necessary if the network is different
        from the network the command is sent on.
        """
        quitMsg = quitMsg or conf.supybot.plugins.Owner.quitMsg() or msg.nick
        otherIrc.queueMsg(ircmsgs.quit(quitMsg))
        otherIrc.die()
        conf.supybot.networks().discard(otherIrc.network)
        if otherIrc != irc:
            irc.replySuccess('Disconnection to %s initiated.' %
                             otherIrc.network)
コード例 #9
0
ファイル: plugin.py プロジェクト: Python3pkg/Limnoria
    def quit(self, irc, msg, args, text):
        """[<text>]

        Exits the bot with the QUIT message <text>.  If <text> is not given,
        the default quit message (supybot.plugins.Owner.quitMsg) will be used.
        If there is no default quitMsg set, your nick will be used. The standard
        substitutions ($version, $nick, etc.) are all handled appropriately.
        """
        text = text or self.registryValue('quitMsg') or msg.nick
        text = ircutils.standardSubstitute(irc, msg, text)
        irc.noReply()
        m = ircmsgs.quit(text)
        world.upkeep()
        for irc in world.ircs[:]:
            irc.queueMsg(m)
            irc.die()
コード例 #10
0
ファイル: plugin.py プロジェクト: Hoaas/Limnoria
    def quit(self, irc, msg, args, text):
        """[<text>]

        Exits the bot with the QUIT message <text>.  If <text> is not given,
        the default quit message (supybot.plugins.Owner.quitMsg) will be used.
        If there is no default quitMsg set, your nick will be used. The standard
        substitutions ($version, $nick, etc.) are all handled appropriately.
        """
        text = text or self.registryValue('quitMsg') or msg.nick
        text = ircutils.standardSubstitute(irc, msg, text)
        irc.noReply()
        m = ircmsgs.quit(text)
        world.upkeep()
        for irc in world.ircs[:]:
            irc.queueMsg(m)
            irc.die()
コード例 #11
0
    def disconnect(self, irc, msg, args, otherIrc, quitMsg):
        """<network> [<quit message>]

        Disconnects from the network represented by the network <network>.
        If <quit message> is given, quits the network with the given quit
        message.
        """
        standard_msg = conf.supybot.plugins.Owner.quitMsg()
        if standard_msg:
            standard_msg = ircutils.standardSubstitute(irc, msg, standard_msg)
        quitMsg = quitMsg or standard_msg or msg.nick
        otherIrc.queueMsg(ircmsgs.quit(quitMsg))
        otherIrc.die()
        conf.supybot.networks().discard(otherIrc.network)
        if otherIrc != irc:
            irc.replySuccess(
                _('Disconnection to %s initiated.') % otherIrc.network)
コード例 #12
0
 def testOuit(self):
     self.prefix = '[email protected]'
     self.irc.feedMsg(msg=ircmsgs.quit(prefix=self.prefix))
     self.assertRegexp('gpg ident', 'not identified')
     chan = irclib.ChannelState()
コード例 #13
0
ファイル: test_ircmsgs.py プロジェクト: ElectroCode/Limnoria
 def testQuit(self):
     self.failUnless(ircmsgs.quit(prefix='foo!bar@baz'))
コード例 #14
0
 def testOuit(self):
     self.prefix = '[email protected]'
     self.irc.feedMsg(msg=ircmsgs.quit(prefix=self.prefix))
     self.assertRegexp('gpg ident', 'not identified')
     chan = irclib.ChannelState()
コード例 #15
0
 def testQuit(self):
     self.assertTrue(ircmsgs.quit(prefix='foo!bar@baz'))
コード例 #16
0
 def testOuit(self):
     self.prefix = "[email protected]"
     self.irc.feedMsg(msg=ircmsgs.quit(prefix=self.prefix))
     self.assertRegexp("gpg ident", "not identified")
     chan = irclib.ChannelState()
コード例 #17
0
ファイル: test_ircmsgs.py プロジェクト: tatokis/Limnoria
 def testQuit(self):
     self.failUnless(ircmsgs.quit(prefix='foo!bar@baz'))