MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / format_size

Method format_size

script/btcli.py:832–838  ·  view source on GitHub ↗

格式化文件大小

(self, size_bytes: int)

Source from the content-addressed store, hash-verified

830 }
831
832 def format_size(self, size_bytes: int) -> str:
833 """格式化文件大小"""
834 for unit in ['B', 'KB', 'MB', 'GB', 'TB']:
835 if size_bytes < 1024.0:
836 return f"{size_bytes:.2f} {unit}"
837 size_bytes /= 1024.0
838 return f"{size_bytes:.2f} PB"
839
840 def should_skip_file(self, filepath: str, rule: Dict) -> bool:
841 """判断文件是否应该跳过"""

Callers 5

show_scan_resultsMethod · 0.95
clean_categoryMethod · 0.95
clean_by_numbersMethod · 0.95
clean_allMethod · 0.95
mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected