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:
parent
3563f92eee
commit
010118ecaf
1 changed files with 4 additions and 2 deletions
|
@ -170,10 +170,12 @@ for preferred, alternatives in compound_project_tasks.items():
|
||||||
# because apparently i really only accepted emdashes for all this time and
|
# because apparently i really only accepted emdashes for all this time and
|
||||||
# never noticed because i use them so consistently.
|
# 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);
|
||||||
|
timelog['project'] = timelog['project'].str.replace(' - ', '—', regex=False);
|
||||||
# If a compound project was specified, break that out into a sub-project (in
|
# 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).
|
# 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['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['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.
|
# Trim any surrounding whitespace from final project and sub-project/task.
|
||||||
timelog['subproject'] = timelog['subproject'].str.strip()
|
timelog['subproject'] = timelog['subproject'].str.strip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue