From e8f7444df60b946f7e29603ff2023024f8d7ebd8 Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 18 Mar 2019 19:27:14 -0400 Subject: [PATCH] FIX: fix for #Preview issue numbering being picked up, FIX: fix for unicode character issue numbering error due to previous commit which was always expecting an alphanumeric as well --- mylar/filechecker.py | 2 +- mylar/helpers.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mylar/filechecker.py b/mylar/filechecker.py index 301d9e01..4eaf0112 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -408,7 +408,7 @@ class FileChecker(object): lastmod_position = 0 booktype = 'issue' #exceptions that are considered alpha-numeric issue numbers - exceptions = ('NOW', 'AI', 'AU', 'X', 'A', 'B', 'C', 'INH', 'MU', 'HU', 'SUMMER', 'SPRING', 'FALL', 'WINTER') + exceptions = ('NOW', 'AI', 'AU', 'X', 'A', 'B', 'C', 'INH', 'MU', 'HU', 'SUMMER', 'SPRING', 'FALL', 'WINTER', 'PREVIEW') #unicode characters, followed by int value # num_exceptions = [{iss:u'\xbd',val:.5},{iss:u'\xbc',val:.25}, {iss:u'\xe',val:.75}, {iss:u'\221e',val:'infinity'}] diff --git a/mylar/helpers.py b/mylar/helpers.py index 22850c73..35a0b0ac 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -1025,7 +1025,11 @@ def issuedigits(issnum): x = [vals[key] for key in vals if key in issnum] if x: - int_issnum = (int(re.sub('[^0-9]', '', issnum).strip()) + x[0]) * 1000 + chk = re.sub('[^0-9]', '', issnum).strip() + if len(chk) == 0: + int_issnum = x[0] * 1000 + else: + int_issnum = (int(re.sub('[^0-9]', '', issnum).strip()) + x[0]) * 1000 #logger.fdebug('int_issnum: ' + str(int_issnum)) else: if any(['.' in issnum, ',' in issnum]):