plugins XEP-0234, file: moved human file size conversion to file plugi
This commit is contained in:
parent
a022a36b5b
commit
674001781f
1 changed files with 4 additions and 4 deletions
|
|
@ -114,12 +114,9 @@ class XEP_0234(object):
|
|||
file_data[name] = ''
|
||||
|
||||
try:
|
||||
size = file_data['size'] = int(file_data['size'])
|
||||
file_data['size'] = int(file_data['size'])
|
||||
except ValueError:
|
||||
raise failure.Failure(exceptions.DataError)
|
||||
else:
|
||||
# human readable size
|
||||
file_data['size_human'] = u'{:.6n} Mio'.format(float(size)/(1024**2))
|
||||
|
||||
name = file_data['name']
|
||||
if '/' in name or '\\' in name:
|
||||
|
|
|
|||
Loading…
Reference in a new issue