From eb3560bb3e906910a8ff22f269cc310441be3f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Tue, 1 Jun 2021 11:23:45 -0400 Subject: [PATCH] Start to prepare for Harvest timelogs precise format export --- pomodoro_to_harvest.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 87617df..a8ea34d 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -146,8 +146,14 @@ for preferred, alternatives in replacement_project_names.items(): # The fillna is essential or we drop entries with blank ('None') projects. tl = timelog.groupby(["date", timelog.project.fillna(""), "description"]).agg({"time": 'sum', "started": 'min', "recorded": 'max'}).reset_index() +# We're doing the final conversion to Harvest as a separate step because we +# want to factor out all of the above non-Harvest-specific logic. + +latest = tl.recorded.max() + if not debug: - tl.to_csv('harvest-ready.csv', index=False) - settings.pomodoro_latest_recorded(tl.recorded.max()) + hvts.to_csv('harvest-timesheets.csv', index=False) + noth.to_csv('not-harvest.csv' + settings.pomodoro_latest_recorded(latest) else: print("We do not write to the harvest-ready.csv nor update the latest recorded setting when run interactively in the python shell.")