mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +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 time
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from dateutil.parser import parse
|
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
URLS = {
|
URLS = {
|
||||||
@ -781,8 +780,9 @@ def _get_latest_image_timestamp(distribution):
|
|||||||
url = URLS[distribution]
|
url = URLS[distribution]
|
||||||
response = urlopen(url[0:url.rindex('/')])
|
response = urlopen(url[0:url.rindex('/')])
|
||||||
page_contents = response.read().decode()
|
page_contents = response.read().decode()
|
||||||
str_time = re.findall(r'\d{2}-[A-Z][a-z]{2}-\d{4}', page_contents)[0]
|
str_time = re.findall(r'\d{2}-[A-Z][a-z]{2}-\d{4} \d{2}:\d{2}',
|
||||||
return parse(str_time).timestamp()
|
page_contents)[0]
|
||||||
|
return datetime.datetime.strptime(str_time, '%d-%b-%Y %H:%M').timestamp()
|
||||||
|
|
||||||
|
|
||||||
def _is_update_required(distribution):
|
def _is_update_required(distribution):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user