aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-02-17 13:38:03 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-02-17 13:38:03 -0500
commitf90518497a5f1dceafbd3b9bdeb6d38a6868a7fe (patch)
tree07a6a243b595dfbfbc43105b3243cd89fff07d49
parent4ab72b4995c5539cd750603138818d41b739c4fa (diff)
downloadkorg-helpers-f90518497a5f1dceafbd3b9bdeb6d38a6868a7fe.tar.gz
Handle another corner case with prefixes
Now should properly handle commas, e.g.: [PATCH 01/02, FOO]. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xget-lore-mbox.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/get-lore-mbox.py b/get-lore-mbox.py
index af9d847..c814812 100755
--- a/get-lore-mbox.py
+++ b/get-lore-mbox.py
@@ -29,7 +29,7 @@ from email import charset
charset.add_charset('utf-8', None)
logger = logging.getLogger('get-lore-mbox')
-VERSION = '0.2.2'
+VERSION = '0.2.3'
# You can use bash-style globbing here
WANTHDRS = [
@@ -536,6 +536,8 @@ class LoreSubject:
while subject.find('[') == 0:
matches = re.search(r'^\[([^\]]*)\]', subject)
for chunk in matches.groups()[0].split():
+ # Remove any trailing commas or semicolons
+ chunk = chunk.strip(',;')
if re.search(r'^\d{1,3}/\d{1,3}$', chunk):
counters = chunk.split('/')
self.counter = int(counters[0])