(value)
| 78 | sys.exit(1) |
| 79 | |
| 80 | def strfbytes(value): |
| 81 | units = ['Bytes', 'KB', 'MB', 'GB', 'TB'] |
| 82 | value = float(value) |
| 83 | for unit in units: |
| 84 | if value < 1024: break |
| 85 | value = value / 1024 |
| 86 | if unit == units[0]: fmt = '%.0f %s' |
| 87 | else: fmt = '%.2f %s' |
| 88 | return fmt % (value, unit) |
| 89 | |
| 90 | |
| 91 | class localHandler: |