本文整理汇总了Python中scheduler.Scheduler.call_later方法的典型用法代码示例。如果您正苦于以下问题:Python Scheduler.call_later方法的具体用法?Python Scheduler.call_later怎么用?Python Scheduler.call_later使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scheduler.Scheduler
的用法示例。
在下文中一共展示了Scheduler.call_later方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import call_later [as 别名]
def __init__(self, instigator, victim, reason):
self.protocol = protocol = instigator.protocol
self.instigator = instigator
self.victim = victim
self.reason = reason
self.votes = {instigator: True}
self.ended = False
protocol.irc_say(S_ANNOUNCE_IRC.format(instigator=instigator.name, victim=victim.name, reason=self.reason))
protocol.send_chat(S_ANNOUNCE.format(instigator=instigator.name, victim=victim.name), sender=instigator)
protocol.send_chat(S_REASON.format(reason=self.reason), sender=instigator)
instigator.send_chat(S_ANNOUNCE_SELF.format(victim=victim.name))
schedule = Scheduler(protocol)
schedule.call_later(self.duration, self.end, S_RESULT_TIMED_OUT)
schedule.loop_call(30.0, self.send_chat_update)
self.schedule = schedule
示例2: __init__
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import call_later [as 别名]
def __init__(self, player, time = 300, reason = 'None'):
if time == 0:
player.mute = True
player.protocol.send_chat('%s was muted indefinitely (Reason: %s)' % (
player.name, reason), irc = True)
return
schedule = Scheduler(player.protocol)
schedule.call_later(time, self.end)
player.mute_schedule = schedule
player.protocol.send_chat('%s was muted for %s seconds (Reason: %s)' % (
player.name, time, reason), irc = True)
player.mute = True
self.player = player
self.time = time
示例3: on_spawn
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import call_later [as 别名]
def on_spawn(self, pos):
self.spawn_time = int( time() )
my_invisible(self)
schedule = Scheduler(self.protocol)
schedule.call_later(self.protocol.ask_time, self.uninvis)
return connection.on_spawn(self, pos)