MCPcopy Create free account
hub / github.com/archlinux/archinstall / PartitionType

Class PartitionType

archinstall/lib/models/device.py:756–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754
755
756class PartitionType(StrEnum):
757 BOOT = auto()
758 PRIMARY = auto()
759 _UNKNOWN = 'unknown'
760
761 @classmethod
762 def get_type_from_code(cls, code: int) -> Self:
763 if code == parted.PARTITION_NORMAL:
764 return cls.PRIMARY
765 else:
766 debug(f'Partition code not supported: {code}')
767 return cls._UNKNOWN
768
769 def get_partition_code(self) -> int | None:
770 if self == PartitionType.PRIMARY:
771 return parted.PARTITION_NORMAL
772 elif self == PartitionType.BOOT:
773 return parted.PARTITION_BOOT
774 return None
775
776
777@dataclass(frozen=True)

Callers 1

parse_argMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected