flush progress print from agnos and neos updaters

old-commit-hash: 7c611cd71120de694f7e6f5186a832578036dac0
This commit is contained in:
Adeeb Shihadeh
2021-10-16 14:13:17 -07:00
parent 5873c32178
commit 087a332532
2 changed files with 2 additions and 2 deletions
+1 -1
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):
+1 -1
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()}'")