diff options
| author | hmj6502 <hashim@hmj6502.com> | 2025-12-19 10:08:37 +0000 |
|---|---|---|
| committer | hmj6502 <hashim@hmj6502.com> | 2025-12-19 10:08:37 +0000 |
| commit | 980e83baf09953efb57b613448fa7f8660ef6973 (patch) | |
| tree | d169d3b2aa522ac2d1e7596b63fafe847f022b70 /main.py | |
| parent | 8ad2527392fbe3fc69a1bca4fa093ace69f3289e (diff) | |
| download | lock-n-log-980e83baf09953efb57b613448fa7f8660ef6973.tar.gz lock-n-log-980e83baf09953efb57b613448fa7f8660ef6973.tar.bz2 lock-n-log-980e83baf09953efb57b613448fa7f8660ef6973.zip | |
add stopwatch functionality
lots of code duplication... next step is to get rid of that
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -45,3 +45,22 @@ if option == 't': #print(session) f.sesh_to_log(session, "lock-n-log.csv") + +else: + print("whenever you're ready, press enter to start", end="", flush=True) + input() + elapsed, start = timers.stopwatch() + + print("\nfocus session finished!\nlogging...") + session = OrderedDict() + session["id"] = hashlib.sha256(str(start).encode('utf8')).hexdigest() + session["date"] = start.strftime("%Y-%m-%d") + session["start"] = start.strftime("%H:%M") + session["elapsed"] = int(elapsed.total_seconds()) + session["type"] = "focus" + session["tag"] = tag + session["timer"] = "stopwatch" + session["ratio"] = 0.2 + #print(session) + + f.sesh_to_log(session, "lock-n-log.csv") |
