def file_size(self):
"""
Obtain the file size for the file in human readable format.
If the file isn't fount, return "0 bytes" rather than crash
:return: String of file size with unit.
"""
try:
return filesizeformat(self.file.size)
except OSError:
return filesizeformat(0)
评论列表
文章目录