From 379da43764c63abc0d76eb3fdedb538daa6d9132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Tue, 1 Jun 2021 20:30:30 -0400 Subject: [PATCH] take one at collecting just known harvest stuff --- pomodoro_to_harvest.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 15e698c..c92f0fa 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -156,9 +156,16 @@ tl = timelog.groupby(["date", timelog.project.fillna(""), "description"]).agg({" latest = tl.recorded.max() +# Filter out any blank projects and any projects we know are not in Harvest. +# We also do the opposite to get a CSV of the excluded items. +non_harvest_list = ["", "Personal", "Near North camp"] +other = tl[tl.project.isin(non_harvest_list)] +harvest = tl[~tl.project.isin(non_harvest_list)] + + if not debug: - hvts.to_csv('harvest-timesheets.csv', index=False) - noth.to_csv('not-harvest.csv' + harvest.to_csv('harvest-timesheets.csv', index=False) + other.to_csv('not-harvest.csv', index=False) 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.")