fix: a full drive is an event, not stderr text

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 19:51:02 +01:00
1 parent 0b0bf29089
commit 8fc294ef97
15 files changed
+457 -491

No files matched your search

+7
View File
@@ -26,3 +26,10 @@ def free_space(bios_path: Path) -> int | None:
return shutil.disk_usage(_nearest_folder(bios_path)).free
except OSError:
return None
def space_shortfall(bios_path: Path, needed: int) -> tuple[int, int] | None:
"""Needed and free when the drive holding bios_path cannot hold needed
bytes, else None, also when its free space cannot be told."""
free = free_space(bios_path)
return None if free is None or free >= needed else (needed, free)