From 49c39184b947074df635f99aea258cba7caa04bd Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Mon, 2 Dec 2019 20:56:16 +0100 Subject: [PATCH] ota_update script: nicer progress display --- scripts/ota_update.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ota_update.py b/scripts/ota_update.py index 35438bb..200731f 100755 --- a/scripts/ota_update.py +++ b/scripts/ota_update.py @@ -66,6 +66,8 @@ if not success: print("Failed.") exit(1) +print() # for proper progress display + with open(filename, "rb") as binfile: filesize = os.stat(filename).st_size @@ -80,11 +82,11 @@ with open(filename, "rb") as binfile: s.send(data) sent_bytes += len(data) - print(f"Sent {sent_bytes} of {filesize} bytes.") + print(f"\rSent {sent_bytes} of {filesize} bytes.") success, message = readMessage(s) print(f"Server message: {message}") if not success: print("Failed.") - exit(1) \ No newline at end of file + exit(1)