本文整理汇总了Python中dtella.common.log.LOG.warning方法的典型用法代码示例。如果您正苦于以下问题:Python LOG.warning方法的具体用法?Python LOG.warning怎么用?Python LOG.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtella.common.log.LOG
的用法示例。
在下文中一共展示了LOG.warning方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleCmd_KILL
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def handleCmd_KILL(self, prefix, args):
l33t = prefix
n00b = args[0]
reason = irc_strip(args[1])
# In most cases, n00b is a UUID, but Anope seems to still use a nick.
# Thus, we have to try both everywhere :-/
# Reconnect the bot if it's killed.
if self.ism.isMyBot(n00b):
if self.ism.syncd:
self.pushBotJoin(do_nick=True)
return
l33t = self.ism.findUser(l33t).inick
# If n00b is a Dtella node, kick 'em.
n = self.ism.findDtellaNode(inick=n00b)
if n:
self.ism.kickDtellaNode(
n, l33t, "KILL: " + reason, send_quit=False)
return
# If n00b is an IRC user, treat it like a QUIT.
try:
n00b_u = self.ism.findUser(n00b)
except KeyError:
LOG.warning("Tried to KILL unknown user: %s" % n00b)
return
message = (
"%s has KILL'd %s: %s" %
(irc_to_dc(l33t), irc_to_dc(n00b_u.inick), reason))
self.ism.removeUser(n00b_u, message)
示例2: handleCmd_ENDBURST
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def handleCmd_ENDBURST(self, prefix, args):
if self.ism.syncd:
# FIXME
LOG.warning("Ignoring ENDBURST")
return
CHECK(self.server_name)
LOG.info("Finished receiving IRC sync data.")
self.showirc = True
# Check for conflicting bridges.
if self.ism.findConflictingBridge():
LOG.error("My nick prefix is in use! Terminating.")
self.transport.loseConnection()
reactor.stop()
return
# Set up nick reservation
scfg = getServiceConfig()
self.ism.killConflictingUsers()
self.sendLine(
":%s ADDLINE Q %s* %s %d 0 :%s" %
(self.sid, cfg.dc_to_irc_prefix, scfg.my_host,
time.time(), self.qline_reason))
# Send my own bridge nick
self.pushBotJoin(do_nick=True)
# When we enter the syncd state, register this instance with Dtella.
# This will eventually trigger event_DtellaUp, where we send our state.
self.schedulePing()
self.ism.addMeToMain()
示例3: handleCmd_QUIT
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def handleCmd_QUIT(self, prefix, args):
uuid = prefix
try:
u = self.ism.findUser(uuid)
except KeyError:
LOG.warning("Can't quit user: %s" % uuid)
else:
self.ism.removeUser(u)
示例4: handleCmd_NICK
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def handleCmd_NICK(self, prefix, args):
# :268AAAAAF NICK Paul 1238303566
old_uuid = prefix
new_nick = args[0]
try:
u = self.ism.findUser(old_uuid)
except KeyError:
# This might be an echo from our KICK.
LOG.warning("NICK: can't find source: %s" % old_uuid)
return
self.ism.changeNick(u, new_nick)
示例5: receivedBlockRequest
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def receivedBlockRequest(self, src_ipp, bhash):
try:
b = self.cached_blocks[bhash]
except KeyError:
LOG.warning("Requested block not found")
return
b.scheduleExpire(self.cached_blocks, bhash)
packet = ['bB']
packet.append(self.main.osm.me.ipp)
packet.append(struct.pack('!H', len(b.data)))
packet.append(b.data)
ad = Ad().setRawIPPort(src_ipp)
self.main.ph.sendPacket(''.join(packet), ad.getAddrTuple())
示例6: cb
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def cb(first):
try:
reactor.listenTCP(dc_port, dfactory, interface='127.0.0.1')
except twisted.internet.error.CannotListenError:
if first:
LOG.warning("TCP bind failed. Killing old process...")
if terminate(dc_port):
LOG.info("Ok. Sleeping...")
reactor.callLater(2.0, cb, False)
else:
LOG.error("Kill failed. Giving up.")
reactor.stop()
else:
LOG.error("Bind failed again. Giving up.")
reactor.stop()
else:
LOG.info("Listening on 127.0.0.1:%d" % dc_port)
dtMain.startConnecting()
示例7: updateFailed
# 需要导入模块: from dtella.common.log import LOG [as 别名]
# 或者: from dtella.common.log.LOG import warning [as 别名]
def updateFailed(self, why):
self.busy = False
LOG.warning("Dconfig Update Failed: %s" % why)
self.scheduleUpdate(cfg.dconfig_push_interval)