mirror of https://github.com/borgbase/vorta
Display "NaN" if size of borg repository is out of bounds (#433)
This commit is contained in:
parent
0c953a98d4
commit
787c36273e
|
@ -102,7 +102,12 @@ def pretty_bytes(size):
|
|||
while size >= power:
|
||||
size /= power
|
||||
n += 1
|
||||
return f'{round(size, 1)} {Dic_powerN[n]}B'
|
||||
try:
|
||||
unit = Dic_powerN[n]
|
||||
return f'{round(size, 1)} {unit}B'
|
||||
except KeyError as e:
|
||||
logger.error(e)
|
||||
return "NaN"
|
||||
|
||||
|
||||
def get_asset(path):
|
||||
|
|
Loading…
Reference in New Issue