diff --git a/src/info_parser.py b/src/info_parser.py index a2f1bc7..57075bf 100644 --- a/src/info_parser.py +++ b/src/info_parser.py @@ -126,9 +126,10 @@ def _filename_from(self, url): return os.path.splitext(os.path.basename(urlparse(url).path))[0] def _app_version_from(self, file_name): - m = re.search('\d{4}-\d{1,2}', file_name) - yearMonth = m.group(0) - (year, month) = map(lambda x: int(x), yearMonth.split("-")) + p = re.compile('(?P\d{4})-(?P\d{1,2})') + m = p.search(file_name) + year = int(m.group('year')) + month = int(m.group('month')) assert (year > 2000) assert (month > 0) assert (month <= 12)