AppStream.SystemInfo¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class AppStream.SystemInfo(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
- Return type:
Creates a new
AppStream.SystemInfo
.New in version 0.10.
- classmethod new_template_for_chassis(chassis)¶
- Parameters:
chassis (
AppStream.ChassisKind
) – theAppStream.ChassisKind
to generate a template for- Raises:
- Returns:
an
AppStream.SystemInfo
template- Return type:
Creates a new
AppStream.SystemInfo
that can be used as a mock system for the given chassis type, reading (mostly) no information from the current system.This function will try to generate a device most representative of the given chassis class. This can be useful when testing compatibility for other devices on a different device that is not of the same chassis type as the one to be tested.
New in version 1.0.0.
- get_device_name_for_modalias(modalias, allow_fallback)¶
- Parameters:
- Raises:
- Returns:
a human-readable device name, or
None
on error.- Return type:
Return a human readable device name for the given modalias. Will return the modalias again if no device name could be found, and returns
None
on error. If allow_fallback is set toFalse
, this function will returnNone
and errorAppStream.SystemInfoError.NOT_FOUND
in case no suitable description could be found.
- get_display_length(side)¶
- Parameters:
side (
AppStream.DisplaySideKind
) – theAppStream.DisplaySideKind
to select.- Returns:
the display size in logical pixels.
- Return type:
Get the current display length for the given side kind. If the display size is unknown, this function will return 0.
- get_gui_available()¶
-
Check whether graphical applications can be displayed via X11 or Wayland.
- get_kernel_name()¶
- Returns:
the current OS kernel name
- Return type:
Get the name of the current kernel, e.g. “Linux”
- get_kernel_version()¶
- Returns:
the current kernel version
- Return type:
Get the version of the current kernel, e.g. “6.2.0-2”
- get_memory_total()¶
- Returns:
the current total amount of usable memory in MiB
- Return type:
Get the current total amount of physical memory in MiB.
- get_modaliases()¶
- Returns:
a list of modaliases on the system.
- Return type:
[
str
]
Get a list of modaliases for all the hardware on this system that has them.
- get_os_cid()¶
- Returns:
the component ID of the current OS.
- Return type:
Get the AppStream component ID of the current operating system.
- get_os_homepage()¶
- Returns:
the homepage of the current OS.
- Return type:
Get the homepage URL of the current operating system.
- get_os_id()¶
- Returns:
the current OS ID.
- Return type:
Get the ID of the current operating system.
- get_os_name()¶
- Returns:
the name of the current OS.
- Return type:
Get the humen-readable name of the current operating system.
- get_os_version()¶
- Returns:
the version of the current OS.
- Return type:
Get the version string of the current operating system.
- has_device_matching_modalias(modalias_glob)¶
- Parameters:
modalias_glob (
str
) – the modalias value to to look for, may contain wildcards.- Returns:
True
if a matching device was found.- Return type:
Check if there is a device on this system that matches the given modalias glob.
- has_input_control(kind)¶
- Parameters:
kind (
AppStream.ControlKind
) – theAppStream.ControlKind
to test for.- Raises:
- Returns:
AppStream.CheckResult.TRUE
if control was found- Return type:
Test if the current system has a specific user input control method. Returns
AppStream.CheckResult.UNKNOWN
if we could not test for an input control method,AppStream.CheckResult.ERROR
on error andAppStream.CheckResult.FALSE
if the control was not found.
- modalias_to_syspath(modalias)¶
- Parameters:
modalias (
str
) – the modalias value to resolve.- Returns:
the syspath, or
None
if none was found.- Return type:
Receive a path in /sys for the devices with the given modalias.
- set_display_length(side, value_dip)¶
- Parameters:
side (
AppStream.DisplaySideKind
) – theAppStream.DisplaySideKind
to select.value_dip (
int
) – the length value in device-independt pixels.
Set the current display length for the given side kind. The size needs to be in device-independent pixels, see the AppStream documentation for more information: https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-relations-display_length
- set_gui_available(available)¶
-
Set whether this system has a GUI / desktop environment available.
- set_input_control(kind, found)¶
- Parameters:
kind (
AppStream.ControlKind
) – theAppStream.ControlKind
to set.found (
bool
) –True
if the control should be marked as found.
Explicitly mark a user input control as present or not present on this system.