diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-02-17 13:38:03 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-02-17 13:38:03 -0500 |
commit | f90518497a5f1dceafbd3b9bdeb6d38a6868a7fe (patch) | |
tree | 07a6a243b595dfbfbc43105b3243cd89fff07d49 | |
parent | 4ab72b4995c5539cd750603138818d41b739c4fa (diff) | |
download | korg-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-x | get-lore-mbox.py | 4 |
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]) |