fixed a bug

This commit is contained in:
eclipse 2025-07-18 23:35:05 +02:00
parent 270085e424
commit 091c977f03

View File

@ -50,8 +50,8 @@ def create_app(config=None):
# helper function to print formatted file size; [source](https://stackoverflow.com/a/1094933) # helper function to print formatted file size; [source](https://stackoverflow.com/a/1094933)
def sizeof_fmt(num: int, suffix: str = "B") -> str: def sizeof_fmt(num: int | str, suffix: str = "B") -> str:
if type(num) == "String": if type(num) == str:
num = int(num) num = int(num)
for unit in ("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"): for unit in ("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"):
if abs(num) < 1024.0: if abs(num) < 1024.0: