platform¶
Attributes¶
Classes¶
Class that allow user to retrieve os/cpu specific information. |
Module Contents¶
- platform.KNOWLEDGE_BASE¶
- class platform.Platform¶
Bases:
collections.namedtuple('Platform', ['cpu','os','is_hie','platform','triplet','machine','domain','is_host','is_default'])Class that allow user to retrieve os/cpu specific information.
Attributes are:
cpu: CPU information
os: Operating System information
is_hie: whether the system is a high integrity system
platform: the platform name, e.g. arm-elf-linux
triplet: the GCC target
machine: machine name
domain: domain name
- is_host: True if the instance represent information for the current
machine
is_default: True if the platform is the default one
- system_info¶
- __slots__ = ()¶
- classmethod get(platform_name: str | None = None, version: str | None = None, machine: str | None = None, mode: str | None = None, compute_default: bool = False, cores: int | None = None) Platform¶
Return a Platform object.
- Parameters:
platform_name – if None or empty then automatically detect current platform (native). Otherwise should be a valid platform string.
version – if None, assume default OS version or find it automatically (native case only). Otherwise should be a valid version string.
machine – name of the machine
mode – an os mode (ex: rtp for vxworks)
compute_default – if True compute the default Arch for the current machine (this parameter is for internal purpose only).
cores – if not None force a number of apparent cores
- to_dict(full_os_version: bool = False) dict[str, Any]¶
Export os and cpu variables as os_{var} and cpu_{var}.
- Parameters:
full_os_version – False by default. If True, use the full os version as OS version (with major, minor etc…) if available. Otherwize, use a potential partial OS version.
- Returns:
a dictionary representing the current Arch instance
- __str__() str¶
Return a representation string of the object.