mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Added exception handling to data.nice_size().
This commit is contained in:
@@ -280,6 +280,10 @@ def nice_size(size):
|
||||
'95.4 Mb'
|
||||
"""
|
||||
words = [ 'bytes', 'Kb', 'Mb', 'Gb' ]
|
||||
try:
|
||||
size = float( size )
|
||||
except:
|
||||
return '??? bytes'
|
||||
for ind, word in enumerate(words):
|
||||
step = 1024 ** (ind + 1)
|
||||
if step > size:
|
||||
|
||||
Reference in New Issue
Block a user