1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-09 22:06:47 +00:00

Better output for log uploading.

This commit is contained in:
Markus Birth 2017-11-13 22:36:01 +01:00
parent 0da722a048
commit 02b3bce1a0
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -15,8 +15,10 @@ LOGS_GLOB = os.path.normpath("logs/*.xml")
headers = { "Content-Type": "text/xml" }
for fn in glob.glob(LOGS_GLOB):
print("Uploading {}".format(fn), end="")
file_list = glob.glob(LOGS_GLOB)
print("Found {} logs to upload.".format(len(file_list)))
for fn in file_list:
print("Uploading {}".format(fn), end="", flush=True)
with open(fn, "rb") as f:
r = requests.post(UPLOAD_URL, data=f, headers=headers)
if r.status_code == 200: