Run function once for cleaner statements

This commit is contained in:
benjamin melançon 2020-07-06 08:45:43 -04:00
parent 42191e8927
commit da3426e196

View file

@ -88,13 +88,13 @@ def main():
log_step('Completed pomodoro: ' + whatdid, start, True) log_step('Completed pomodoro: ' + whatdid, start, True)
continue continue
except KeyboardInterrupt: except KeyboardInterrupt:
time_spent = datetime.now(pytz.utc) - start time_spent = str_minutes(datetime.now(pytz.utc) - start)
print('\n{} time spent, save?'.format(str_minutes(time_spent)) print('\n{} time spent, save?'.format(time_spent))
choice = input('[y]/n: ').strip() choice = input('[y]/n: ').strip()
if choice.lower() in ('y', 'yes', ''): if choice.lower() in ('y', 'yes', ''):
whatdid = pomodoro_prompt_report(whatnext) whatdid = pomodoro_prompt_report(whatnext)
record_task(whatdid, start) record_task(whatdid, start)
log_step('Incomplete (' + str_minutes(time_spent) + ') pomodoro: ' + whatdid, start, True) log_step('Incomplete (' + time_spent + ') pomodoro: ' + whatdid, start, True)
else: else:
quit_prompt() quit_prompt()
else: else: