AppStream.SystemInfo

g AppStream.SystemInfo AppStream.SystemInfo GObject.Object GObject.Object GObject.Object->AppStream.SystemInfo

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_template_for_chassis (chassis)

get_device_name_for_modalias (modalias, allow_fallback)

get_display_length (side)

get_gui_available ()

get_kernel_name ()

get_kernel_version ()

get_memory_total ()

get_modaliases ()

get_os_cid ()

get_os_homepage ()

get_os_id ()

get_os_name ()

get_os_version ()

has_device_matching_modalias (modalias_glob)

has_input_control (kind)

modalias_to_syspath (modalias)

set_display_length (side, value_dip)

set_gui_available (available)

set_input_control (kind, found)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class AppStream.SystemInfo(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStream.SystemInfoClass

classmethod new()
Returns:

a AppStream.SystemInfo

Return type:

AppStream.SystemInfo

Creates a new AppStream.SystemInfo.

New in version 0.10.

classmethod new_template_for_chassis(chassis)
Parameters:

chassis (AppStream.ChassisKind) – the AppStream.ChassisKind to generate a template for

Raises:

GLib.Error

Returns:

an AppStream.SystemInfo template

Return type:

AppStream.SystemInfo

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:
  • modalias (str) – the modalias value to resolve (may contain wildcards).

  • allow_fallback (bool) – fall back to low-quality data if no better information is available

Raises:

GLib.Error

Returns:

a human-readable device name, or None on error.

Return type:

str

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 to False, this function will return None and error AppStream.SystemInfoError.NOT_FOUND in case no suitable description could be found.

get_display_length(side)
Parameters:

side (AppStream.DisplaySideKind) – the AppStream.DisplaySideKind to select.

Returns:

the display size in logical pixels.

Return type:

int

Get the current display length for the given side kind. If the display size is unknown, this function will return 0.

get_gui_available()
Returns:

True if graphical applications can be displayed.

Return type:

bool

Check whether graphical applications can be displayed via X11 or Wayland.

get_kernel_name()
Returns:

the current OS kernel name

Return type:

str

Get the name of the current kernel, e.g. “Linux”

get_kernel_version()
Returns:

the current kernel version

Return type:

str

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:

int

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:

str

Get the AppStream component ID of the current operating system.

get_os_homepage()
Returns:

the homepage of the current OS.

Return type:

str

Get the homepage URL of the current operating system.

get_os_id()
Returns:

the current OS ID.

Return type:

str

Get the ID of the current operating system.

get_os_name()
Returns:

the name of the current OS.

Return type:

str

Get the humen-readable name of the current operating system.

get_os_version()
Returns:

the version of the current OS.

Return type:

str

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:

bool

Check if there is a device on this system that matches the given modalias glob.

has_input_control(kind)
Parameters:

kind (AppStream.ControlKind) – the AppStream.ControlKind to test for.

Raises:

GLib.Error

Returns:

AppStream.CheckResult.TRUE if control was found

Return type:

AppStream.CheckResult

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 and AppStream.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:

str

Receive a path in /sys for the devices with the given modalias.

set_display_length(side, value_dip)
Parameters:

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)
Parameters:

available (bool) – True if GUI is available.

Set whether this system has a GUI / desktop environment available.

set_input_control(kind, found)
Parameters:

Explicitly mark a user input control as present or not present on this system.