Commit bbbf4abc authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files
parents 24f0b196 78bc5bf8
......@@ -105,11 +105,11 @@ def get_nb_string(value, length=6):
def get_nb_octet(size):
"""
Return the number of bytes: value has to be formated like this: 5Mb, 20Gb ...
Return the number of Byte : value has to be formated like this: 5MB, 20GB ...
"""
octets_link = ["bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb"]
octets_link = ["Bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB"]
if size.endswith("bytes"):
unit = "bytes"
unit = "Bytes"
isize = size[:len(size)-5]
else:
unit = size[len(size)-2:len(size)]
......@@ -121,9 +121,9 @@ def get_nb_octet(size):
def get_octet_string_representation(size):
"""
Return the string representation of a byte
Return the string representation of a Byte
"""
octets_link = ["bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb"]
octets_link = ["Bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB"]
p = int(math.ceil(float(len(str(size)))/float(3) - float(1)))
pow_needed = p * 10
pow_needed = pow(2, pow_needed)
......@@ -238,4 +238,4 @@ def validate_email(email, check_mx=False,verify=False):
continue
except (AssertionError, ServerError):
return False
return True
\ No newline at end of file
return True
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