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
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue