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


Python scheduler.Scheduler方法代码示例

本文整理汇总了Python中scheduler.Scheduler方法的典型用法代码示例。如果您正苦于以下问题:Python scheduler.Scheduler方法的具体用法?Python scheduler.Scheduler怎么用?Python scheduler.Scheduler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scheduler的用法示例。


在下文中一共展示了scheduler.Scheduler方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [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:piqueserver,项目名称:piqueserver,代码行数:21,代码来源:timedmute.py

示例2: start

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def start(self):
        instigator = self.instigator
        protocol = self.protocol
        if instigator is None:
            protocol.send_chat('Time to vote!', irc=True)
        else:
            protocol.send_chat(
                '* %s initiated a map vote.' % instigator.name, irc=True)
        self.schedule = schedule = Scheduler(protocol)
        schedule.call_later(self.vote_time, self.timeout)
        schedule.loop_call(30.0, self.update)
        self.protocol.votemap = self
        self.update() 
开发者ID:piqueserver,项目名称:piqueserver,代码行数:15,代码来源:votemap.py

示例3: main

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def main():
    pos = (0,0,0)
    attitude = (0,0,np.pi/2)
    quadcopter = Quadcopter(pos, attitude)
    sched = scheduler.Scheduler()
    sched.add_task(attitudeControl, dt, (quadcopter,time))
    kEvent_Render = sched.add_event(render, (quadcopter,))
    plt.plot_quad_3d((sched, kEvent_Render))
    try:
        while True:
            thread_time.sleep(5)
    except KeyboardInterrupt:
        print ("attempting to close threads.")
        sched.stop()
        print ("terminated.") 
开发者ID:hbd730,项目名称:quadcopter-simulation,代码行数:17,代码来源:runsim.py

示例4: main

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def main():
    """main function"""

    # get directory name
    basedir = os.path.dirname(os.path.abspath(__file__))

    # configure logging
    logging.basedir = basedir + "/logs"
    logging.config.fileConfig(basedir + "/etc/logging.conf")

    # init
    config = Config()
    scheduler = Scheduler()
    webapp_conf = {
        "bind": config.get_value("Webserver", "bind", "0.0.0.0:5000"),
        "workers": int(config.get_value("Webserver", "workers", "1"))
    }
    webapp = WebApplication(wsgi_app, webapp_conf)

    # run scheduler
    print("Starting opennms_alarmforwarder...")
    proc_webapp = Process(target=webapp.run)
    proc_scheduler = Process(target=scheduler.run)
    proc_webapp.start()
    proc_scheduler.start()
    signal.signal(signal.SIGTERM, process_helper.shutdown_handler)
    signal.signal(signal.SIGINT, process_helper.shutdown_handler)

    try:
        proc_scheduler.join()
        proc_webapp.join()
    except:
        print("Stopping opennms_alarmforwarder...")
        proc_scheduler.terminate()
        proc_webapp.terminate()
        print("...exited") 
开发者ID:NETHINKS,项目名称:opennms_alarmforwarder,代码行数:38,代码来源:opennms_alarmforwarder.py

示例5: __init__

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def __init__(self, someprocess=None, logit=True, ticks=sys.maxint):
		super(Executor,self).__init__()
		if someprocess:
			self.process = someprocess
		else:
			if ticks < sys.maxint:
				ticks += 1
			self.process = Scheduler(ticks=ticks, name="")
		self.logit = logit
		self.linker = Linker() 
开发者ID:Mizzlr,项目名称:NetFlux-Component-Oriented-Flow-Based-Programming-DSL,代码行数:12,代码来源:executor.py

示例6: __init__

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def __init__(self, mongo, ctx, tokens, api_key):
        self.mongo = mongo
        self.log = SlackArchive.get_logger()
        self.people = mongo_store.MongoStore(self.mongo.db.users, ctx)
        self.streams = mongo_store.MongoStore(self.mongo.db.streams, ctx)
        self.tokens = tokens
        self.api_handle = Slacker(api_key)
        self.scheduler = scheduler.Scheduler(ctx, mongo)
        self._setup_scheduler()
        self.scheduler.start() 
开发者ID:n8v-guy,项目名称:slag,代码行数:12,代码来源:slack_archive.py

示例7: scheduler

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def scheduler(ctx):
    """Run Scheduler."""
    from fulmar.scheduler.projectdb import projectdb
    from fulmar.message_queue import newtask_queue, ready_queue, cron_queue
    from scheduler import Scheduler
    scheduler = Scheduler(newtask_queue, ready_queue, cron_queue, projectdb)
    scheduler.run() 
开发者ID:tylderen,项目名称:fulmar,代码行数:9,代码来源:cli.py

示例8: __init__

# 需要导入模块: import scheduler [as 别名]
# 或者: from scheduler import Scheduler [as 别名]
def __init__ (self, loop, bus=None, path=PATH):
        self.loop = loop
        self.bus = bus or dbus.SystemBus( )
        self.path = path
        request = self.bus.request_name(BUS, dbus.bus.NAME_FLAG_DO_NOT_QUEUE)
        self.running = False
        ScheduleManager.__init__(self, self.bus, PATH)
        self.sync_all_props( )
        self.init_managed( )
        self.ResetHeartbeat( )
        self.scheduler = scheduler.Scheduler(self.bus, self)
        self.background = doable.Doable(self)
        self.eventsink = triggers.EventSink(self.bus, self)
        # self.connect("notify::ini-home", self.on_change_home) 
开发者ID:openaps,项目名称:oacids,代码行数:16,代码来源:service.py


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