def pomo_one_Alarm(pomoParams): secondsTable,modeTable= pomo_one_genScheme(pomoParams) kbd_lstn = KbdListener(AlarmController) kbd_lstn.start() # Never stop unless user terminate it in console for seconds,mode in zip(secondsTable,modeTable): one_pomo_alarm = Pomodoro_One_Behavior(seconds=seconds,mode=mode) one_pomo = Alarm(one_pomo_alarm) one_pomo.timer(seconds)
def pomo_Alarm(name, mode_Type, is_Dynamic_Scheme): execute_Timetable, execute_Modetable \ = read_Scheme_JSON(name, mode_Type, is_Dynamic_Scheme) currentTime = datetime.now().time() kbd_lstn = KbdListener(AlarmController) kbd_lstn.start() # Stop when the day (timetable) end. for start_end_period, mode in zip(execute_Timetable, execute_Modetable): if currentTime <= start_end_period[1]: pomo_alarm = Pomo_Alarm_Behavior(start_end_period[0], start_end_period[1], mode) alarm = Alarm(pomo_alarm) alarm.timer(end_datetime=start_end_period[1])