diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 9c9763c..869d91f 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -168,20 +168,22 @@ latest = tl.recorded.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. -harvest = tl[tl.project.isin(harvest_project_names.keys())] +hrvst = tl[tl.project.isin(harvest_project_names.keys())] other = tl[tl.project.isin(other_project_names.keys())] unknown = tl[~tl.project.isin(replacement_project_names.keys())] -harvest.rename(columns = {'date': 'Date', 'project': 'Project', 'description': 'Note'}, inplace = True) +harvest = hrvst.rename(columns = {'date': 'Date', 'project': 'Project', 'subproject': 'Task', 'description': 'Note'}) +harvest["Hours"] = harvest["time"]/60 harvest["First name"] = "Benjamin" harvest["Last name"] = "Melançon" +harvest.drop(columns = ['started', 'recorded', 'time'], inplace=True) if not debug: harvest.to_csv('harvest-timesheets.csv', index=False) other.to_csv('not-harvest.csv', index=False) settings.pomodoro_latest_recorded(latest) else: - harvest_grouped = harvest.groupby("project").agg({"time": "sum"})["time"]/60 + hrvst_grouped = hrvst.groupby("project").agg({"time": "sum"})["time"]/60 other_grouped = other.groupby("project").agg({"time": "sum"})["time"]/60 unknown_grouped = unknown.groupby("project").agg({"time": "sum"})["time"]/60 print("We do not write to the harvest-ready.csv nor update the latest recorded setting when run interactively in the python shell.")