当前位置: 首页>>代码示例>>Python>>正文


Python Scheduler.call_later方法代码示例

本文整理汇总了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
开发者ID:NickBurrill,项目名称:PiSnip,代码行数:19,代码来源:votekick.py

示例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
开发者ID:Lorex2000,项目名称:pyspades-userscripts,代码行数:19,代码来源:timedmute.py

示例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)
开发者ID:Lorex2000,项目名称:pyspades-userscripts,代码行数:8,代码来源:antispawnkill.py


注:本文中的scheduler.Scheduler.call_later方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。