calendarwatch_frontend/routine.py

18 lines
333 B
Python
Raw Normal View History

#!/usr/bin/env python3
2020-05-15 16:05:45 +02:00
from backend.Routine import Routine
import sched, time
2020-05-15 16:05:45 +02:00
s = sched.scheduler(time.time, time.sleep)
2020-05-15 16:05:45 +02:00
routine = Routine()
def run_routine(sc):
# do some stuff
routine.start()
#schedule next routine
s.enter(600, 1, run_routine, (sc,))
2020-05-15 16:05:45 +02:00
routine.start()
s.enter(600, 1, run_routine, (s, ))
s.run()