Helper function to print device properties with aligned formatting. Parameters ---------- label : str Property label value : any Property value indent : int Number of spaces for indentation (default: 2)
(label, value, indent=2)
| 45 | |
| 46 | |
| 47 | def print_property(label, value, indent=2): |
| 48 | """ |
| 49 | Helper function to print device properties with aligned formatting. |
| 50 | |
| 51 | Parameters |
| 52 | ---------- |
| 53 | label : str |
| 54 | Property label |
| 55 | value : any |
| 56 | Property value |
| 57 | indent : int |
| 58 | Number of spaces for indentation (default: 2) |
| 59 | """ |
| 60 | field_width = 47 |
| 61 | spaces = " " * indent |
| 62 | print(f"{spaces}{label:<{field_width}}{value}") |
| 63 | |
| 64 | |
| 65 | def fmt_bytes(size_in_bytes): |