ota_update script: nicer progress display
This commit is contained in:
parent
1c899c1f24
commit
49c39184b9
|
@ -66,6 +66,8 @@ if not success:
|
||||||
print("Failed.")
|
print("Failed.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
print() # for proper progress display
|
||||||
|
|
||||||
with open(filename, "rb") as binfile:
|
with open(filename, "rb") as binfile:
|
||||||
filesize = os.stat(filename).st_size
|
filesize = os.stat(filename).st_size
|
||||||
|
|
||||||
|
@ -80,11 +82,11 @@ with open(filename, "rb") as binfile:
|
||||||
s.send(data)
|
s.send(data)
|
||||||
sent_bytes += len(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)
|
success, message = readMessage(s)
|
||||||
print(f"Server message: {message}")
|
print(f"Server message: {message}")
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
print("Failed.")
|
print("Failed.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Reference in a new issue