| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Declutters PyTypeObject struct initialization when declaring new types.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Call Partition_AddModuleObject when initializing the python module.
Fixes bug when using the Partition class but the class has not
been added to the module via Py_TypeReady.
A common error was the type not being ready (missing attributes):
>>> for pa in cxt.parts:
... print(pa.partno)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
AttributeError: 'libfdisk.Partition' object has no attribute 'partno'
|
|
|
|
| |
LGPL2.1 or later.
|
|
|
|
| |
Add MANIFEST.in to include .h files in source distributions.
|
|
Add sources, setup.py and .gitignore
Build/Install:
python setup.py build
python setup.py install
|