From d16f8bed780090781a5179641d4121f67ab6329f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Fri, 10 Jun 2022 15:55:43 -0400 Subject: [PATCH] Trim whitespace before regex for time multiplyier --- pomodoro_to_harvest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 03fa0fd..64a36cf 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -112,6 +112,9 @@ timelog.tmp_timeshift = '(' + timelog.tmp_timeshift + ')' timelog['tmp_timeshift'] = timelog['tmp_timeshift'].fillna("") timelog['description'] = timelog.apply(lambda x: x['description'].replace(x['tmp_timeshift'], ''), axis=1) +# Be sure to trim any whitespace before we regex for ending on asterisk number. +timelog['description'] = timelog['description'].str.strip() + # If a multiplier has been provided (an asterisk and an integer at the end of a # task), then multiply the time by it and remove it from the description. # Ensure we're splitting on the same asterisk we found: Use the end of string