From 059956c5890fde173309d5b4e35d98220e1cd137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sun, 5 Jul 2020 19:05:40 -0400 Subject: [PATCH] Use most recent plan/task for placeholder, and make sure we always return a string --- pomodoroprompt.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pomodoroprompt.py b/pomodoroprompt.py index 6ada2e1..e4e957b 100644 --- a/pomodoroprompt.py +++ b/pomodoroprompt.py @@ -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):