Skip to content

LinuxDeviceInfo 继承自: DeviceInfo

Linux 系统的设备信息。

更多信息:

属性 ​

名称类型默认值说明
namestrrequiredA string identifying the operating system, without a version component, and suitable for presentation to the user. Examples: "Fedora", "Debian GNU/Linux". If not set, defaults to "Linux".
idstrrequiredA lower-case string identifying the operating system, excluding any version information and suitable for processing by scripts or usage in generated filenames. The ID contains no spaces or other characters outside of 0–9, a–z, '.', '_' and '-'. Examples: "fedora", "debian". If not set, defaults to "linux".
pretty_namestrrequiredA pretty operating system name in a format suitable for presentation to the user. May or may not contain a release code name or OS version of some kind, as suitable. Examples: "Fedora 17 (Beefy Miracle)". If not set, defaults to "Linux".
versionOptional[str]NoneA string identifying the operating system version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user. Examples: "17", "17 (Beefy Miracle)". May be None on some systems.
id_likeOptional[list[str]]NoneA space-separated list of operating system identifiers in the same syntax as the id value. It lists identifiers of operating systems that are closely related to the local operating system in regards to packaging and programming interfaces, for example listing one or more OS identifiers the local OS is a derivative from. Examples: an operating system with id "centos", would list "rhel" and "fedora", and an operating system with id "ubuntu" would list "debian". May be None on some systems.
version_code_nameOptional[str]NoneA lower-case string identifying the operating system release code name, excluding any OS name information or release version, and suitable for processing by scripts or usage in generated filenames. The codename contains no spaces or other characters outside of 0–9, a–z, '.', '_' and '-'. Examples: "buster", "xenial". May be None on some systems.
version_idOptional[str]NoneA lower-case string identifying the operating system version, excluding any OS name information or release code name, and suitable for processing by scripts or usage in generated filenames. The version is mostly numeric, and contains no spaces or other characters outside of 0–9, a–z, '.', '_' and '-'. Examples: "17", "11.04". May be None on some systems.
build_idOptional[str]NoneA string uniquely identifying the system image used as the origin for a distribution (it is not updated with system updates). The field can be identical between different version_id values as build_id is only a unique identifier to a specific version. Examples: "2013-03-20.3", "201303203". May be None on some systems.
variantOptional[str]NoneA string identifying a specific variant or edition of the operating system suitable for presentation to the user. This field may be used to inform the user that the configuration of this system is subject to a specific divergent set of rules or default configuration settings. Examples: "Server Edition", "Smart Refrigerator Edition". Note: this field is for display purposes only. The variant_id field should be used for making programmatic decisions. May be None on some systems.
variant_idOptional[str]NoneA lower-case string identifying a specific variant or edition of the operating system. This may be interpreted in order to determine a divergent default configuration. The variant ID contains no spaces or other characters outside of 0–9, a–z, '.', '_' and '-'. Examples: "server", "embedded". May be None on some systems.
machine_idOptional[str]NoneA unique machine ID of the local system that is set during installation or boot. The machine ID is hexadecimal, 32-character, lowercase ID. When decoded from hexadecimal, this corresponds to a 16-byte/128-bit value.
localeslist[Locale]requiredThe full system-reported supported locales of the device. This establishes the language and formatting conventions that application should, if possible, use to render their user interface. The list is ordered in order of priority, with lower-indexed locales being preferred over higher-indexed ones. The first element is the primary locale. The on_locale_change event is called whenever this value changes.

关注我,学习大模型、大数据、Python等热门技术。