[apple] Refactor script (#213)
Make the script more readable, mostly by: - using the endoflife.Product class, - removing the unnecessary use of functions, - a little bit of renaming.
This commit is contained in:
@@ -42,6 +42,7 @@ def parse_datetime(text, formats=frozenset([
|
||||
"""
|
||||
# so that we don't have to deal with some special characters in formats
|
||||
text = text.strip().replace(", ", " ").replace(". ", " ").replace("(", "").replace(")", "")
|
||||
text = text.replace("Sept ", "Sep ") # common typo, for ex. on Apple and Artifactory products
|
||||
for fmt in formats:
|
||||
try:
|
||||
date = datetime.strptime(text, fmt)
|
||||
|
||||
Reference in New Issue
Block a user