Include date in filename for less chance of mistakes and easier archiving

This commit is contained in:
benjamin melançon 2021-06-18 21:26:34 -04:00
parent fab23d3090
commit 7bfb46dff3

View file

@ -199,6 +199,7 @@ tl = timelog.groupby(["date", timelog.project.fillna(""), timelog.subproject.fil
# want to factor out all of the above non-Harvest-specific logic.
latest = tl.recorded.max()
datest = str(tl.date.max())
# Separate Harvest from non-Harvest projects, and also filter out any blank
# projects, but save those too for a CSV of the excluded items.
@ -215,9 +216,9 @@ harvest["Client"] = harvest["Project"].map(project_client_mapping)
harvest.drop(columns = ['started', 'recorded', 'time'], inplace=True)
if not debug:
harvest.to_csv('harvest-timesheets.csv', index=False)
other.to_csv('personal-other.csv', index=False)
unknown.to_csv('unknown.csv', index=False)
harvest.to_csv('harvest-timesheets-' + datest + '.csv', index=False)
other.to_csv('personal-other-' + datest + '.csv', index=False)
unknown.to_csv('unknown-' + datest + '.csv', index=False)
settings.pomodoro_latest_recorded(latest)
else:
hrvst_grouped = hrvst.groupby("project").agg({"time": "sum"})["time"]/60