(val, units, divisor)
| 103 | label_prefix += " " |
| 104 | |
| 105 | def prettyprint(val, units, divisor): |
| 106 | for unit in units: |
| 107 | if val < divisor: |
| 108 | if unit == units[0]: |
| 109 | return "%d%s" % (val, unit) |
| 110 | else: |
| 111 | return "%3.2f%s" % (val, unit) |
| 112 | val /= divisor |
| 113 | |
| 114 | def prettyprint_bytes(byte_val): |
| 115 | return prettyprint(byte_val, [' B', ' KB', ' MB', ' GB', ' TB'], 1024.0) |
no outgoing calls
no test coverage detected