flush progress print from agnos and neos updaters

pull/22585/head
Adeeb Shihadeh 2021-10-16 14:13:17 -07:00
parent 085c424cf9
commit 7c611cd711
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ def download_file(url: str, fn: str, sha256: str, display_name: str, cloudlog=lo
for chunk in r.iter_content(chunk_size=1024 * 1024):
f.write(chunk)
print(f"Downloading {display_name}: {f.tell() / total * 100}")
print(f"Downloading {display_name}: {f.tell() / total * 100}", flush=True)
except Exception:
cloudlog.error("download error")
if os.path.isfile(fn):

View File

@ -156,7 +156,7 @@ def flash_partition(target_slot_number: int, partition: dict, cloudlog):
p = int(out.tell() / partition['size'] * 100)
if p != last_p:
last_p = p
print(f"Installing {partition['name']}: {p}")
print(f"Installing {partition['name']}: {p}", flush=True)
if raw_hash.hexdigest().lower() != partition['hash_raw'].lower():
raise Exception(f"Raw hash mismatch '{raw_hash.hexdigest().lower()}'")