flush progress print from agnos and neos updaters
parent
085c424cf9
commit
7c611cd711
|
@ -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):
|
||||
|
|
|
@ -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()}'")
|
||||
|
|
Loading…
Reference in New Issue