本文整理汇总了Python中supybot.ircmsgs.quit函数的典型用法代码示例。如果您正苦于以下问题:Python quit函数的具体用法?Python quit怎么用?Python quit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了quit函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testJoin
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='[email protected]'))
self.failUnless('foo' in st.channels['#foo'].users)
st2 = st.copy()
st.addMsg(self.irc, ircmsgs.quit(prefix='[email protected]'))
self.failIf('foo' in st.channels['#foo'].users)
self.failUnless('foo' in st2.channels['#foo'].users)
示例2: reconnect
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()
示例3: quit
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: disconnect
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)
示例5: quit
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()
示例6: testOuit
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()
示例7: testQuit
def testQuit(self):
self.failUnless(ircmsgs.quit(prefix='[email protected]'))