Should be working!

This commit is contained in:
benjamin melançon 2020-07-05 16:00:19 -04:00
parent 3d097e6084
commit 3e8c348fe1

View file

@ -12,9 +12,11 @@ LONG_MIN = 15
def pomodoro_prompt_plan(whatdid = ''): 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') 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): 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') 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): def record_task(whatdid, start, end=None):
if end is None: if end is None:
@ -30,10 +32,10 @@ def main():
start = datetime.now(pytz.utc) start = datetime.now(pytz.utc)
end = start + timedelta(minutes=WORK_MIN, seconds=0) end = start + timedelta(minutes=WORK_MIN, seconds=0)
try: try:
print('Task -', line) print('Task -', whatnext)
while True: while datetime.now(pytz.utc) <= end:
diff = datetime.now(pytz.utc)-start to_go = end-datetime.now(pytz.utc)
print('\r', str(diff).split('.')[0], sep='', end='') print('\r', str(to_go).split('.')[0], sep='', end='')
time.sleep(1) time.sleep(1)
whatdid = pomodoro_prompt_report(whatnext) whatdid = pomodoro_prompt_report(whatnext)
record_task(whatdid, start) record_task(whatdid, start)