本文整理汇总了Python中twisted.words.protocols.irc.IRCClient.connectionLost方法的典型用法代码示例。如果您正苦于以下问题:Python IRCClient.connectionLost方法的具体用法?Python IRCClient.connectionLost怎么用?Python IRCClient.connectionLost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.words.protocols.irc.IRCClient
的用法示例。
在下文中一共展示了IRCClient.connectionLost方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
for channel in self.factory.channels:
self.left(channel)
loggirc2('Connection lost because: %s.' % reason)
self.log("[disconnected at %s]" % time.asctime(time.localtime(time.time())))
self.logger[config.BOTNAME].close()
IRCClient.connectionLost(self, reason)
示例2: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
log.warn(
"Disconnected from %s (%s:%s): %s" % (self.servername, self.factory.hostname, self.factory.port, reason)
)
IRCClient.connectionLost(self, reason)
try:
self.l.stop() # All done now.
except AssertionError:
pass # We never managed to connect in the first place!
示例3: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
log.msg("[disconnected at %s]" % time.asctime(time.localtime(time.time())))
示例4: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
for logger in self.loggers.values():
logger.log("[disconnected at %s]" %
time.asctime(time.localtime(time.time())))
logger.close()
示例5: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
self.container._setBotinst(None)
if self.state: self.state._resetnetwork()
# TODO: reason needs to be properly formatted/actual reason being extracted from the "Failure" or whatever
print "[disconnected: %s]" % reason
示例6: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
示例7: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
RCBot.log('Server', "Disconnected")
IRCClient.connectionLost(self, reason)
示例8: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
log.msg("[%s] Connection lost, unregistering." % self.host)
relayer.unregister(self)
示例9: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
print('disconnected')
reactor.connectTCP(config["host"], config["port"], KittyFactory())
示例10: connectionLost
# 需要导入模块: from twisted.words.protocols.irc import IRCClient [as 别名]
# 或者: from twisted.words.protocols.irc.IRCClient import connectionLost [as 别名]
def connectionLost(self, reason):
IRCClient.connectionLost(self, reason)
self.l.stop() # All done now.
log.warn("Disconnected from %s" % self.servername)