Commit 6f8f3e81 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

Remove convert_bytes method

parent 5e20799d
Pipeline #3828 passed with stages
in 2 minutes and 43 seconds
...@@ -576,44 +576,6 @@ def datetime_tuple(timestamp): ...@@ -576,44 +576,6 @@ def datetime_tuple(timestamp):
tim = tim.timetuple() tim = tim.timetuple()
return tim return tim
def convert_bytes(string_):
suffix = ''
# IEC standard says KiB = 1024 bytes KB = 1000 bytes
# but do we use the standard?
use_kib_mib = app.config.get('use_kib_mib')
align = 1024.
bytes_ = float(string_)
if bytes_ >= align:
bytes_ = round(bytes_/align, 1)
if bytes_ >= align:
bytes_ = round(bytes_/align, 1)
if bytes_ >= align:
bytes_ = round(bytes_/align, 1)
if use_kib_mib:
#GiB means gibibyte
suffix = _('%s GiB')
else:
#GB means gigabyte
suffix = _('%s GB')
else:
if use_kib_mib:
#MiB means mibibyte
suffix = _('%s MiB')
else:
#MB means megabyte
suffix = _('%s MB')
else:
if use_kib_mib:
#KiB means kibibyte
suffix = _('%s KiB')
else:
#KB means kilo bytes
suffix = _('%s KB')
else:
#B means bytes
suffix = _('%s B')
return suffix % str(bytes_)
def get_contact_dict_for_account(account): def get_contact_dict_for_account(account):
""" """
Create a dict of jid, nick -> contact with all contacts of account. Create a dict of jid, nick -> contact with all contacts of account.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment