plugins XEP-0234, file: moved human file size conversion to file plugi

This commit is contained in:
Goffi 2015-11-11 18:19:49 +01:00
commit 674001781f

View file

@ -170,11 +170,14 @@ class FilePlugin(object):
It may content the key used in CONFIRM constant
It *MUST NOT* contain the "peer" key
"file_path" will be added to this dict once destination selected
"size_human" will also be added with human readable file size
@param profile: %(doc_profile)s
return (defer.Deferred): True if transfer is accepted
"""
filename = file_data['name']
assert filename and not '/' in filename
# human readable size
file_data['size_human'] = u'{:.6n} Mio'.format(float(file_data['size'])/(1024**2))
d = xml_tools.deferDialog(self.host,
_(CONFIRM).format(peer=peer_jid.full(), **file_data),
_(CONFIRM_TITLE),