mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
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:
parent
359a0acd1a
commit
7d143c9ef2
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user