From 3e8c348fe16e3037d3aacd4625c6f4c81456b268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sun, 5 Jul 2020 16:00:19 -0400 Subject: [PATCH] Should be working! --- pomodoroprompt.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pomodoroprompt.py b/pomodoroprompt.py index 4f55855..6ada2e1 100644 --- a/pomodoroprompt.py +++ b/pomodoroprompt.py @@ -12,9 +12,11 @@ LONG_MIN = 15 def pomodoro_prompt_plan(whatdid = ''): whatnext = zenipy.zenipy.entry(text="What're you gonna do?", placeholder='Same thing i did last time', title='Pomodoro Prompt: Plan') + return whatnext def pomodoro_prompt_report(whatnext): whatdid = zenipy.zenipy.entry(text="What'd you do?", placeholder='What i said i would do', title='Pomodoro Prompt: Report') + return whatdid def record_task(whatdid, start, end=None): if end is None: @@ -30,10 +32,10 @@ def main(): start = datetime.now(pytz.utc) end = start + timedelta(minutes=WORK_MIN, seconds=0) try: - print('Task -', line) - while True: - diff = datetime.now(pytz.utc)-start - print('\r', str(diff).split('.')[0], sep='', end='') + print('Task -', whatnext) + while datetime.now(pytz.utc) <= end: + to_go = end-datetime.now(pytz.utc) + print('\r', str(to_go).split('.')[0], sep='', end='') time.sleep(1) whatdid = pomodoro_prompt_report(whatnext) record_task(whatdid, start)