AppStreamCompose.Hint

g AppStreamCompose.Hint AppStreamCompose.Hint GObject.Object GObject.Object GObject.Object->AppStreamCompose.Hint

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_for_tag (tag)

add_explanation_var (var_name, text)

format_explanation ()

get_explanation_template ()

get_explanation_vars_list ()

get_severity ()

get_tag ()

is_error ()

is_valid ()

set_explanation_template (explanation_tmpl)

set_severity (severity)

set_tag (tag)

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

GObject.Object

Abstract:

No

Structure:

AppStreamCompose.HintClass

classmethod new()
Return type:

AppStreamCompose.Hint

Creates a new AppStreamCompose.Hint.

classmethod new_for_tag(tag)
Parameters:

tag (str) – The tag ID to construct this hint for.

Raises:

GLib.Error

Return type:

AppStreamCompose.Hint

Creates a new AppStreamCompose.Hint with the given tag. If the selected tag was not registered+ with the global tag registry, None is returned and an error is set.

add_explanation_var(var_name, text)
Parameters:
  • var_name (str) – Name of the variable to be replaced.

  • text (str) – Replacement for the variable name.

Add a replacement variable for the explanation text.

format_explanation()
Returns:

Explanation text for this hint, with variables replaced.

Return type:

str

Formats the explanation template to return a human-redable issue hint explanation, with all placeholder variables replaced.

get_explanation_template()
Return type:

str

Gets the explanation template for this hint.

get_explanation_vars_list()
Returns:

A flattened GLib.PtrArray with the key/value pairs.

Return type:

[str]

Returns a list with the flattened key/value pairs for this hint. Values are located in uneven list entries, following their keys in even list entries.

get_severity()
Return type:

AppStream.IssueSeverity

Gets the issue severity of this hint.

get_tag()
Return type:

str

Gets the unique tag for the type of this hint.

is_error()
Returns:

True if this hint describes an error.

Return type:

bool

is_valid()
Returns:

True if this hint is valid.

Return type:

bool

Check if this hint is valid (it requires at least a tag and a severity in order to be considered valid).

set_explanation_template(explanation_tmpl)
Parameters:

explanation_tmpl (str) –

Sets the explanation template for this hint.

set_severity(severity)
Parameters:

severity (AppStream.IssueSeverity) –

Sets the issue severity of this hint.

set_tag(tag)
Parameters:

tag (str) –

Sets the unique tag for the type of this hint.