From 445aa1d8c56e49d831b74fbe96d37b53f1c8f0ac Mon Sep 17 00:00:00 2001 From: mlncn Date: Sun, 2 May 2021 12:16:52 -0400 Subject: [PATCH] Add whatnext (intention) to CSV log now that we have sophisticated analysis capabilities --- pomodoroprompt.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pomodoroprompt.py b/pomodoroprompt.py index 2f8d9b2..d8e429c 100644 --- a/pomodoroprompt.py +++ b/pomodoroprompt.py @@ -74,15 +74,15 @@ def log_step(text, utc_start, end_section=False): timelog.write('\n\n') -def record_task(whatdid, start, end=None): +def record_task(whatnext, whatdid, start, end=None): """ Record completed pomodoro to CSV """ if end is None: end = datetime.now(pytz.utc) - with open('timelog.csv', 'a', newline='') as csvfile: - # TODO make first line started, recorded, description + with open('log/timelog.csv', 'a', newline='') as csvfile: + # TODO make first line started, recorded, description, intention timewriter = csv.writer(csvfile) - timewriter.writerow([start, end, whatdid]) + timewriter.writerow([start, end, whatdid, whatnext]) def str_minutes(time_diff): """ Return at least whole seconds from a time difference @@ -111,7 +111,7 @@ def main(): if not QUIET: playsound('res/timesup.aac') whatdid = pomodoro_prompt_report(whatnext) - record_task(whatdid, start) + record_task(whatnext, whatdid, start) log_step('Completed pomodoro: ' + whatdid, start, True) print('Worked on: ' + whatdid) @@ -136,13 +136,13 @@ def main(): choice = input('[y]/n: ').strip() if choice.lower() in ('y', 'yes', ''): whatdid = pomodoro_prompt_report(whatnext) - record_task(whatdid, start) + record_task(whatnext, whatdid, start) log_step('Incomplete (' + time_spent_str + ') pomodoro: ' + whatdid, start, True) quit_prompt() else: print('What did you break?') # If we somehow end up here, try a last-ditch effort to save. - record_task('Incomplete, interrupted task:' + whatnext, start) + record_task(whatnext, 'Incomplete, interrupted task:' + whatnext, start) log_step('Incomplete, interrupted task:' + whatnext, start, True)