AppStream.Relation

g AppStream.Relation AppStream.Relation GObject.Object GObject.Object GObject.Object->AppStream.Relation

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

check_results_get_compatibility_score (rc_results)

class

new ()

get_compare ()

get_display_side_kind ()

get_item_kind ()

get_kind ()

get_value_control_kind ()

get_value_int ()

get_value_internet_bandwidth ()

get_value_internet_kind ()

get_value_px ()

get_value_str ()

get_version ()

is_satisfied (system_info, pool)

set_compare (compare)

set_display_side_kind (kind)

set_item_kind (kind)

set_kind (kind)

set_value_control_kind (kind)

set_value_int (value)

set_value_internet_bandwidth (bandwidth_mbitps)

set_value_internet_kind (kind)

set_value_px (logical_px)

set_value_str (value)

set_version (version)

version_compare (version)

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.Relation(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStream.RelationClass

classmethod check_results_get_compatibility_score(rc_results)
Parameters:

rc_results ([AppStream.RelationCheckResult]) – an array of AppStream.RelationCheckResult

Return type:

int

Calculate a compatibility sore between 0 and 100 based on the given set of AsRelationCheckResults.

A compatibility of 100 means all requirements are satisfied and the component will run perfectly on the confoguration it was tested agains, while 0 means it will not run at all.

classmethod new()
Returns:

a AppStream.Relation

Return type:

AppStream.Relation

Creates a new AppStream.Relation.

New in version 0.11.0.

get_compare()
Returns:

an enum of type AppStream.RelationCompare

Return type:

AppStream.RelationCompare

The version comparison type.

New in version 0.12.0.

get_display_side_kind()
Returns:

a AppStream.DisplaySideKind or AppStream.DisplaySideKind.UNKNOWN

Return type:

AppStream.DisplaySideKind

Gets the display side kind, in case this item is of kind AppStream.RelationItemKind.DISPLAY_LENGTH

New in version 0.12.12.

get_item_kind()
Returns:

an enum of type AppStream.RelationItemKind

Return type:

AppStream.RelationItemKind

The kind of the item of this AppStream.Relation.

New in version 0.12.0.

get_kind()
Returns:

an enum of type AppStream.RelationKind

Return type:

AppStream.RelationKind

The type (and thereby strength) of this AppStream.Relation.

New in version 0.12.0.

get_value_control_kind()
Returns:

a AppStream.ControlKind or AppStream.ControlKind.UNKNOWN in case the item is not of the right kind.

Return type:

AppStream.ControlKind

Get the value of this AppStream.Relation item as AppStream.ControlKind if the type of this relation is AppStream.RelationItemKind.CONTROL. Otherwise return AppStream.ControlKind.UNKNOWN

New in version 0.12.11.

get_value_int()
Returns:

The value of this AppStream.Relation item as an integer. Returns 0 if the value was no integer.

Return type:

int

New in version 0.12.0.

get_value_internet_bandwidth()
Returns:

The minimum bandwidth requirement, in Mbit/s.

Return type:

int

If this AppStream.Relation is of kind AppStream.RelationItemKind.INTERNET, return the minimum bandwidth requirement of the component, if set.

If the relation is of a different kind, or the requirement isn’t set, this returns 0.

New in version 0.15.5.

get_value_internet_kind()
Returns:

a AppStream.InternetKind or AppStream.InternetKind.UNKNOWN in case the item is not of the right kind.

Return type:

AppStream.InternetKind

Get the value of this AppStream.Relation item as AppStream.InternetKind if the type of this relation is AppStream.RelationItemKind.INTERNET. Otherwise return AppStream.InternetKind.UNKNOWN

New in version 0.15.5.

get_value_px()
Returns:

The logical pixel amount for this display length, value <= 0 on error.

Return type:

int

In case this AppStream.Relation is of kind AppStream.RelationItemKind.DISPLAY_LENGTH, return the set logical pixel amount.

New in version 0.12.12.

get_value_str()
Returns:

The value of the item this AppStream.Relation is about, as a string.

Return type:

str

New in version 0.12.12.

get_version()
Returns:

The version of the item this AppStream.Relation is about.

Return type:

str

New in version 0.12.0.

is_satisfied(system_info, pool)
Parameters:
Raises:

GLib.Error

Returns:

an AppStream.RelationCheckResult with details about the result, or None on error.

Return type:

AppStream.RelationCheckResult or None

Test if this relation is satisfied on the current system or with the provided AppStream.Pool. If no AppStream.SystemInfo is found, a temporary one will be created. If no AppStream.Pool is provided, any component relationships can not be validated and an error will be thrown.

set_compare(compare)
Parameters:

compare (AppStream.RelationCompare) – the new AppStream.RelationCompare

Set the version comparison type of this AppStream.Relation.

New in version 0.12.0.

set_display_side_kind(kind)
Parameters:

kind (AppStream.DisplaySideKind) – the new AppStream.DisplaySideKind.

Sets the display side kind, in case this item is of kind AppStream.RelationItemKind.DISPLAY_LENGTH

New in version 0.12.12.

set_item_kind(kind)
Parameters:

kind (AppStream.RelationItemKind) – the new AppStream.RelationItemKind

Set the kind of the item this AppStream.Relation is about.

New in version 0.12.0.

set_kind(kind)
Parameters:

kind (AppStream.RelationKind) – the new AppStream.RelationKind

Set the kind of this AppStream.Relation.

New in version 0.12.0.

set_value_control_kind(kind)
Parameters:

kind (AppStream.ControlKind) – an AppStream.ControlKind

Set relation item value from an AppStream.ControlKind.

New in version 0.12.12.

set_value_int(value)
Parameters:

value (int) – the new value.

Sets the item value as an integer, if the given item type of this AppStream.Relation permits integer values.

New in version 0.12.12.

set_value_internet_bandwidth(bandwidth_mbitps)
Parameters:

bandwidth_mbitps (int) –

set_value_internet_kind(kind)
Parameters:

kind (AppStream.InternetKind) – an AppStream.InternetKind

Set relation item value from an AppStream.InternetKind.

New in version 0.15.5.

set_value_px(logical_px)
Parameters:

logical_px (int) – logical pixel count.

Sets the item value as logical pixel count. This requires the relation to be of item kind AppStream.RelationItemKind.DISPLAY_LENGTH.

New in version 0.12.12.

set_value_str(value)
Parameters:

value (str) – the new value.

Sets the item value as a string, if the given item type of this AppStream.Relation permits string values.

New in version 0.12.12.

set_version(version)
Parameters:

version (str) – the new version.

Sets the item version.

New in version 0.12.0.

version_compare(version)
Parameters:

version (str) – a version number, e.g. 1.2.0

Raises:

GLib.Error

Returns:

True if the version from the parameter is sufficient.

Return type:

bool

Tests whether the version number of this AppStream.Relation is fulfilled by version. Whether the given version is sufficient to fulfill the version requirement of this AppStream.Relation is determined by its comparison resraint.

New in version 0.12.0.