mirror of
https://github.com/danieldemus/deconz_fw_downloader.git
synced 2025-01-10 15:12:00 +01:00
Fixing logging and add timestamp
This commit is contained in:
parent
d66434f37c
commit
d49fe409a9
@ -1,4 +1,5 @@
|
||||
FROM python:3-alpine
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN mkdir /otau
|
||||
|
||||
|
@ -13,7 +13,8 @@ except ImportError:
|
||||
from urllib import urlretrieve
|
||||
|
||||
now = datetime.datetime.now()
|
||||
print ('%s - Downloadscript started' % now.strftime("%Y-%m-%d %H:%M"))
|
||||
|
||||
print ('%s - Downloadscript started' % f"{datetime.datetime.now():%Y-%m-%d %H:%M:%S}")
|
||||
|
||||
f = urlopen("http://fw.ota.homesmart.ikea.net/feed/version_info.json")
|
||||
data = f.read()
|
||||
@ -36,9 +37,9 @@ for i in arr:
|
||||
|
||||
if not os.path.isfile(path):
|
||||
urlretrieve(url, path)
|
||||
print(path)
|
||||
print('%s - %s downloaded' % (now.strftime("%Y-%m-%d %H:%M:%S"), path))
|
||||
else:
|
||||
print('%s - %s already exists' % (now.strftime("%Y-%m-%d %H:%M"), fname))
|
||||
print('%s - %s already exists' % (now.strftime("%Y-%m-%d %H:%M:%S"), fname))
|
||||
|
||||
|
||||
"""
|
||||
@ -68,8 +69,8 @@ for x in range(len(productlist)):
|
||||
file = open(path, "wb")
|
||||
file.write(firmwarecontent)
|
||||
file.close()
|
||||
print('%s - %s downloaded' % (now.strftime("%Y-%m-%d %H:%M"), path))
|
||||
print('%s - %s downloaded' % (now.strftime("%Y-%m-%d %H:%M:%S"), path))
|
||||
else:
|
||||
print('%s - %s already exists' % (now.strftime("%Y-%m-%d %H:%M"), fname))
|
||||
print('%s - %s already exists' % (now.strftime("%Y-%m-%d %H:%M:%S"), fname))
|
||||
|
||||
print ('%s - Downloadscript stopped' % now.strftime("%Y-%m-%d %H:%M"))
|
||||
print ('%s - Downloadscript stopped' % now.strftime("%Y-%m-%d %H:%M:%S"))
|
Loading…
Reference in New Issue
Block a user