From 3563f92eee513e4679eb064cdb49f408a1f4b7a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 1 Jul 2025 12:29:40 -0400 Subject: [PATCH] Allow attempted emdash (three dashes where i missed the compose key) --- pomodoro_to_harvest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 5602e4b..6485303 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -166,6 +166,10 @@ for preferred, alternatives in compound_project_tasks.items(): alternatives = [item.lower() for item in alternatives] timelog.loc[timelog.project.str.lower().isin(alternatives), "project"] = preferred +# Replace single dashes, en-dashes, and attempts at em-dashes with emdashes +# because apparently i really only accepted emdashes for all this time and +# never noticed because i use them so consistently. +timelog['project'] = timelog['project'].str.replace('---', '—', regex=False); # If a compound project was specified, break that out into a sub-project (in # Harvest, we use Task, which is really task type, for this). timelog['subproject'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[1], None))