Don't try to record pomodoro if we're in a break (start set to none)
Also talk a bit more in the CLI, more feedback
This commit is contained in:
parent
bbf11c1bb1
commit
cc94fab95f
1 changed files with 18 additions and 8 deletions
|
@ -87,6 +87,11 @@ def main():
|
||||||
whatdid = pomodoro_prompt_report(whatnext)
|
whatdid = pomodoro_prompt_report(whatnext)
|
||||||
record_task(whatdid, start)
|
record_task(whatdid, start)
|
||||||
log_step('Completed pomodoro: ' + whatdid, start, True)
|
log_step('Completed pomodoro: ' + whatdid, start, True)
|
||||||
|
print('Worked on: ' + whatdid)
|
||||||
|
|
||||||
|
print('Break time!')
|
||||||
|
# We're taking a break. Clear out task start/end times.
|
||||||
|
start = None
|
||||||
end = datetime.now(pytz.utc) + timedelta(minutes=SHORT_MIN)
|
end = datetime.now(pytz.utc) + timedelta(minutes=SHORT_MIN)
|
||||||
while datetime.now(pytz.utc) <= end:
|
while datetime.now(pytz.utc) <= end:
|
||||||
to_go = end-datetime.now(pytz.utc)
|
to_go = end-datetime.now(pytz.utc)
|
||||||
|
@ -94,15 +99,20 @@ def main():
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
continue
|
continue
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
if start is None:
|
||||||
|
quit_prompt()
|
||||||
|
continue
|
||||||
time_spent = datetime.now(pytz.utc) - start
|
time_spent = datetime.now(pytz.utc) - start
|
||||||
if time_spent > timedelta(minutes=INTERRUPTED_MIN):
|
if time_spent < timedelta(minutes=INTERRUPTED_MIN):
|
||||||
time_spent_str = str_minutes(time_spent)
|
quit_prompt()
|
||||||
print('\n{} time spent, save?'.format(time_spent_str))
|
continue
|
||||||
choice = input('[y]/n: ').strip()
|
time_spent_str = str_minutes(time_spent)
|
||||||
if choice.lower() in ('y', 'yes', ''):
|
print('\n{} time spent, save?'.format(time_spent_str))
|
||||||
whatdid = pomodoro_prompt_report(whatnext)
|
choice = input('[y]/n: ').strip()
|
||||||
record_task(whatdid, start)
|
if choice.lower() in ('y', 'yes', ''):
|
||||||
log_step('Incomplete (' + time_spent_str + ') pomodoro: ' + whatdid, start, True)
|
whatdid = pomodoro_prompt_report(whatnext)
|
||||||
|
record_task(whatdid, start)
|
||||||
|
log_step('Incomplete (' + time_spent_str + ') pomodoro: ' + whatdid, start, True)
|
||||||
quit_prompt()
|
quit_prompt()
|
||||||
else:
|
else:
|
||||||
print('What did you break?')
|
print('What did you break?')
|
||||||
|
|
Loading…
Reference in a new issue