MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _format_bytes

Function _format_bytes

deployments/desktop/shared/agents.py:443–451  ·  view source on GitHub ↗
(value: int)

Source from the content-addressed store, hash-verified

441 return total
442
443
444def _format_bytes(value: int) -> str:
445 size = float(max(0, int(value or 0)))
446 for unit in ("B", "KB", "MB", "GB", "TB"):
447 if size < 1024 or unit == "TB":
448 if unit == "B":
449 return f"{int(size)}B"
450 return f"{size:.1f}{unit}"
451 size /= 1024
452 return "0B"
453
454

Callers 1

_storage_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected