container: Remove external depenceny - dateutil

Used a function from the standard library instead.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Joseph Nuthalapati authored and Veiko Aasa committed 2020-07-11 11:57:55 +03:00
1 parent 359a0acd1a
commit 7d143c9ef2
1 file changed
+3 -3
+3 -3
View File
@@ -126,7 +126,6 @@ import tempfile
import time
import urllib.parse
from dateutil.parser import parse
from urllib.request import urlopen
URLS = {
@@ -781,8 +780,9 @@ def _get_latest_image_timestamp(distribution):
url = URLS[distribution]
response = urlopen(url[0:url.rindex('/')])
page_contents = response.read().decode()
str_time = re.findall(r'\d{2}-[A-Z][a-z]{2}-\d{4}', page_contents)[0]
return parse(str_time).timestamp()
str_time = re.findall(r'\d{2}-[A-Z][a-z]{2}-\d{4} \d{2}:\d{2}',
page_contents)[0]
return datetime.datetime.strptime(str_time, '%d-%b-%Y %H:%M').timestamp()
def _is_update_required(distribution):