Allow different dash attempts and even single dashes, emdashes no longer need to be surrounded by spaces to separate project and task but single dashes do

This commit is contained in:
benjamin melançon 2025-07-01 12:32:51 -04:00
parent 3563f92eee
commit 010118ecaf

View file

@ -170,6 +170,8 @@ for preferred, alternatives in compound_project_tasks.items():
# 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);
timelog['project'] = timelog['project'].str.replace('--', '', regex=False);
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))