Get a human-readable string for number of bytes.
(bytes)
| 27 | |
| 28 | |
| 29 | def readable_bytes_string(bytes): |
| 30 | """Get a human-readable string for number of bytes.""" |
| 31 | if bytes >= 2**20: |
| 32 | return "%.1f MB" % (float(bytes) / 2**20) |
| 33 | elif bytes >= 2**10: |
| 34 | return "%.1f kB" % (float(bytes) / 2**10) |
| 35 | else: |
| 36 | return "%d B" % bytes |
| 37 | |
| 38 | |
| 39 | class UploadStats: |
no outgoing calls
no test coverage detected
searching dependent graphs…