Use most recent plan/task for placeholder, and make sure we always return a string

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

View file

@ -11,11 +11,17 @@ 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')
whatnext = zenipy.zenipy.entry(text="What're you gonna do?", placeholder=whatdid, title='Pomodoro Prompt: Plan')
# Pressing cancel returns None, but we want to just treat it as an empty string.
if whatnext is None:
whatnext = ''
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')
whatdid = zenipy.zenipy.entry(text="What'd you do?", placeholder=whatnext, title='Pomodoro Prompt: Report')
# Pressing cancel returns None, but we want to just treat it as an empty string.
if whatdid is None:
whatdid = ''
return whatdid
def record_task(whatdid, start, end=None):