From ec2e79b59f1df32802a2004aecd2c718f1df5bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Fri, 20 Jun 2025 12:59:31 -0400 Subject: [PATCH] Un-hard-code harvest user accountholder name --- pomodoro_to_harvest.py | 4 ++-- settings.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 5dda542..cfba74a 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -287,8 +287,8 @@ unknown = tl[~tl.project.isin(replacement_project_names.keys())] harvest = hrvst.rename(columns = {'date': 'Date', 'project': 'Project', 'subproject': 'Task', 'description': 'Notes'}) harvest["Hours"] = harvest["time"]/60 -harvest["First name"] = "Benjamin" -harvest["Last name"] = "Melançon" +harvest["First name"] = settings.harvest_get_profile_firstname() +harvest["Last name"] = settings.harvest_get_profile_lastname() project_client_mapping = settings.harvest_get_projects_clients_map() harvest["Client"] = harvest["Project"].map(project_client_mapping) harvest.drop(columns = ['started', 'recorded', 'time'], inplace=True) diff --git a/settings.py b/settings.py index 4e8a66e..3d334a6 100644 --- a/settings.py +++ b/settings.py @@ -53,3 +53,9 @@ def harvest_get_projects_clients_map(): return json.loads(harvest['projects_clients']) else: sys.exit("No project clients available; run fetch_clients_projects.py") + +def harvest_get_profile_firstname(): + return config['harvest']['profile_first_name'] + +def harvest_get_profile_lastname(): + return config['harvest']['profile_last_name']