From 046c6fb742de3d5a8e6eda08f4b3c7db7c13611d Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 26 Feb 2020 23:13:47 +0100 Subject: [PATCH] Add Pause tasks which counts as a break. --- data.py | 3 ++- main.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data.py b/data.py index 1e34fe3..c7fd59b 100644 --- a/data.py +++ b/data.py @@ -179,7 +179,8 @@ class Report: if i < len(tmp) - 1: end_time = tmp[i+1][1] duration = end_time - start_time - dsum += duration + if task != "Pause": + dsum += duration dhours, rem = divmod(duration.seconds, 3600) dmins, _ = divmod(rem, 60) ret.append([task, start_time.strftime("%H:%M"), f"{dhours:02d}:{dmins:02d}"]) diff --git a/main.py b/main.py index e84d5b5..9ec1043 100644 --- a/main.py +++ b/main.py @@ -56,6 +56,7 @@ class App: def update_tray_menu(self): self.menu.clear() tasks = list(self.tasks.tasks) + tasks.append("Pause") tasks.append("Nothing") for t in tasks: