diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 4e88929..5602e4b 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -166,16 +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); -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)) -timelog['project'] = (np.where(timelog['project'].str.contains('—'), timelog['project'].str.split('—', n=1).str[0], timelog['project'])) +timelog['subproject'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[1], None)) +timelog['project'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[0], timelog['project'])) # Trim any surrounding whitespace from final project and sub-project/task. timelog['subproject'] = timelog['subproject'].str.strip()