Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 374 → Rev 375

/branches/BR-0.4/basico/services/srv_utils.py
129,7 → 129,7
 
 
def get_kilobytes(self, integer_bytes):
kilo, bites = divmod(int(abs(integer_bytes)), 1_024)
kilo, bites = divmod(int(abs(integer_bytes)), 1024)
# ~ self.log.debug("%d bytes -> %d Kb", integer_bytes, kilo)
return kilo
 
136,7 → 136,7
 
def get_megabytes(self, integer_bytes):
kilo = self.get_kilobytes(integer_bytes)
mega, kilo = divmod(kilo, 1_024)
mega, kilo = divmod(kilo, 1024)
# ~ self.log.debug("%d bytes -> %d Mb", integer_bytes, mega)
return mega
 
143,7 → 143,7
 
def get_gigabytes(self, integer_bytes):
mega = self.get_megabytes(integer_bytes)
giga, mega = divmod(mega, 1_024)
giga, mega = divmod(mega, 1024)
# ~ self.log.debug("%d bytes -> %d Gb", integer_bytes, giga)
return giga