1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
b71c765e34 🤖 Bumped version to 0.1.52
All checks were successful
Build Python Container / Package-Container (push) Successful in 2m53s
Package Python / Package (push) Successful in 26s
Run Python tests (through Pytest) / Test (push) Successful in 34s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 30s
This commit was automatically generated by a script: https://gitfub.space/Jmaa/repo-manager
2024-11-16 18:39:30 +01:00
a5c36d7acb
Import parse util 2024-11-08 21:42:33 +01:00
2 changed files with 4 additions and 2 deletions

View File

@ -1 +1 @@
__version__ = '0.1.51' __version__ = '0.1.52'

View File

@ -22,7 +22,7 @@ FORMAT_DATE_HEADER = '%a, %d %b %Y %H:%M:%S GMT'
def parse_duration(text: str) -> datetime.timedelta: def parse_duration(text: str) -> datetime.timedelta:
(num_str, unit_str) = text.split(' ') (num_str, unit_str) = text.split(' ')
num = int(num_str) num = float(num_str)
unit = DATETIME_UNITS[unit_str] unit = DATETIME_UNITS[unit_str]
return unit * num return unit * num
@ -78,5 +78,7 @@ def parse_date(text: str) -> datetime.date:
return dt.date() return dt.date()
if dt := try_parse(text, '%B %d, %Y'): if dt := try_parse(text, '%B %d, %Y'):
return dt.date() return dt.date()
if dt := try_parse(text, '%b %d'):
return dt.date()
msg = 'Unknown format: ' + text msg = 'Unknown format: ' + text
raise RuntimeError(msg) raise RuntimeError(msg)