diff options
author | Jose M. Guisado Gomez <guigom@riseup.net> | 2022-06-07 16:18:15 +0200 |
---|---|---|
committer | Jose M. Guisado Gomez <guigom@riseup.net> | 2022-06-07 16:21:51 +0200 |
commit | 0747a84d1cd7e49549b551ae7d02a3c619bd4ab2 (patch) | |
tree | 39ace47cf690729711285da7610367a5410b56f4 /setup.py | |
parent | ba67cc7a7b5e69b2a39a4aab5805e7915152db16 (diff) |
context: add size_unit getset
Size unit can be get or set using 'size_unit' context member.
>>> for pa in cxt.partitions:
... cxt.partition_to_string(pa, fdisk.FDISK_FIELD_SIZE)
...
'114.6G'
>>> cxt.size_unit
0
>>> cxt.size_unit == fdisk.FDISK_SIZEUNIT_HUMAN
True
>>> cxt.size_unit = fdisk.FDISK_SIZEUNIT_BYTES
>>> for pa in cxt.partitions:
... cxt.partition_to_string(pa, fdisk.FDISK_FIELD_SIZE)
...
'123010531328'
Use fdisk_get_size_unit to get size unit value.
https://cdn.kernel.org/pub/linux/utils/util-linux/v2.34/libfdisk-docs/libfdisk-Context.html#fdisk-get-size-unit
Use fdisk_set_size_unit to set size unit value.
https://cdn.kernel.org/pub/linux/utils/util-linux/v2.34/libfdisk-docs/libfdisk-Context.html#fdisk-set-size-unit
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions