AppStream.Component

g AppStream.Component AppStream.Component GObject.Object GObject.Object GObject.Object->AppStream.Component

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_addon (addon)

add_agreement (agreement)

add_bundle (bundle)

add_category (category)

add_content_rating (content_rating)

add_extends (cpt_id)

add_icon (icon)

add_keyword (keyword, locale)

add_language (locale, percentage)

add_launchable (launchable)

add_provided (prov)

add_provided_item (kind, item)

add_reference (reference)

add_relation (relation)

add_release (release)

add_replaces (cid)

add_review (review)

add_screenshot (sshot)

add_suggested (suggested)

add_tag (ns, tag)

add_translation (tr)

add_url (url_kind, url)

check_relations (sysinfo, pool, rel_kind)

clear_keywords (locale)

clear_languages ()

clear_tags ()

get_addons ()

get_agreement_by_kind (kind)

get_agreements ()

get_branch ()

get_branding ()

get_bundle (bundle_kind)

get_bundles ()

get_categories ()

get_compulsory_for_desktops ()

get_content_rating (kind)

get_content_ratings ()

get_context ()

get_custom ()

get_custom_value (key)

get_data_id ()

get_date_eol ()

get_description ()

get_developer ()

get_extends ()

get_icon_by_size (width, height)

get_icon_stock ()

get_icons ()

get_id ()

get_keywords ()

get_keywords_table ()

get_kind ()

get_language (locale)

get_languages ()

get_launchable (kind)

get_launchables ()

get_merge_kind ()

get_metadata_license ()

get_name ()

get_name_table ()

get_name_variant_suffix ()

get_origin ()

get_pkgname ()

get_pkgnames ()

get_priority ()

get_project_group ()

get_project_license ()

get_provided ()

get_provided_for_kind (kind)

get_recommends ()

get_references ()

get_releases_plain ()

get_replaces ()

get_requires ()

get_reviews ()

get_scope ()

get_screenshots_all ()

get_search_tokens ()

get_sort_score ()

get_source_pkgname ()

get_suggested ()

get_summary ()

get_summary_table ()

get_supports ()

get_system_compatibility_score (sysinfo, is_template)

get_timestamp_eol ()

get_translations ()

get_url (url_kind)

has_bundle ()

has_category (category)

has_tag (ns, tag)

insert_custom_value (key, value)

is_compulsory_for_desktop (desktop)

is_floss ()

is_ignored ()

is_member_of_category (category)

is_valid ()

load_from_bytes (context, format, bytes)

load_releases (allow_net)

remove_tag (ns, tag)

search_matches (term)

search_matches_all (terms)

set_branch (branch)

set_branding (branding)

set_compulsory_for_desktop (desktop)

set_context (context)

set_context_locale (locale)

set_data_id (value)

set_date_eol (date)

set_description (value, locale)

set_developer (developer)

set_id (value)

set_keywords (new_keywords, locale, deep_copy)

set_kind (value)

set_merge_kind (kind)

set_metadata_license (value)

set_name (value, locale)

set_name_variant_suffix (value, locale)

set_origin (origin)

set_pkgname (pkgname)

set_pkgnames (packages)

set_priority (priority)

set_project_group (value)

set_project_license (value)

set_releases (releases)

set_scope (scope)

set_sort_score (score)

set_source_pkgname (spkgname)

set_summary (value, locale)

sort_screenshots (environment, style, prioritize_style)

to_string ()

to_xml_data (context)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

categories

GLib.PtrArray

r

categories

description

str

r/w

description

icons

int

r

icons

id

str

r/w

id

keywords

[str]

r/w

keywords

kind

AppStream.ComponentKind

r/w

kind

name

str

r/w

name

pkgnames

[str]

r/w

pkgnames

project-group

str

r/w

project-group

project-license

str

r/w

project-license

screenshots

GLib.PtrArray

r

screenshots

summary

str

r/w

summary

urls

GLib.HashTable

r

urls

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class AppStream.Component(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStream.ComponentClass

classmethod new()
Returns:

a new AppStream.Component

Return type:

AppStream.Component

Creates a new AppStream.Component.

add_addon(addon)
Parameters:

addon (AppStream.Component) – The AppStream.Component that extends self

Add a reference to the addon that is enhancing this component.

New in version 0.9.2.

add_agreement(agreement)
Parameters:

agreement (AppStream.Agreement) – an AppStream.Agreement instance.

Adds an agreement to the software component.

New in version 0.12.1.

add_bundle(bundle)
Parameters:

bundle (AppStream.Bundle) – The AppStream.Bundle to add.

Adds a bundle to the component.

New in version 0.8.0.

add_category(category)
Parameters:

category (str) – the categories name to add.

Add a category.

add_content_rating(content_rating)
Parameters:

content_rating (AppStream.ContentRating) – a AppStream.ContentRating instance.

Adds a content rating to this component.

New in version 0.11.0.

add_extends(cpt_id)
Parameters:

cpt_id (str) – The id of a component which is extended by this component

Add a reference to the extended component

New in version 0.15.5.

add_icon(icon)
Parameters:

icon (AppStream.Icon) – the valid AppStream.Icon instance to add.

Add an icon to this component.

add_keyword(keyword, locale)
Parameters:
  • keyword (str) – The new keyword to add.

  • locale (str or None) – BCP47 locale of the values, or None to use current locale.

Add a new keyword to the keywords list for the given locale. This function does not check for duplicate keywords.

add_language(locale, percentage)
Parameters:
  • locale (str or None) – the BCP47 locale, or None. e.g. “en-GB”

  • percentage (int) – the percentage completion of the translation, 0 for locales with unknown amount of translation

Adds a language to the component.

New in version 0.7.0.

add_launchable(launchable)
Parameters:

launchable (AppStream.Launchable) – a AppStream.Launchable instance.

Adds a AppStream.Launchable containing launchables entries for this component.

New in version 0.11.0.

add_provided(prov)
Parameters:

prov (AppStream.Provided) – a AppStream.Provided instance.

Add a set of provided items to this component.

New in version 0.6.2.

add_provided_item(kind, item)
Parameters:

Adds a provided item to the component with the given kind, creating a new AsProvided for this kind internally if necessary.

add_reference(reference)
Parameters:

reference (AppStream.Reference) – an AppStream.Reference instance.

Adds an external reference to the software component.

New in version 1.0.0.

add_relation(relation)
Parameters:

relation (AppStream.Relation) – a AppStream.Relation instance.

Adds a AppStream.Relation to set a recommends or requires relation of component self on the item mentioned in the AppStream.Relation.

New in version 0.12.0.

add_release(release)
Parameters:

release (AppStream.Release) – The AppStream.Release to add

Add an AppStream.Release to this component.

add_replaces(cid)
Parameters:

cid (str) – an AppStream component ID

Add the component ID of a component that gets replaced by the current component.

add_review(review)
Parameters:

review (AppStream.Review) – a AppStream.Review instance.

Adds a user review to a software component.

New in version 0.14.0.

add_screenshot(sshot)
Parameters:

sshot (AppStream.Screenshot) – The AppStream.Screenshot to add

Add an AppStream.Screenshot to this component.

add_suggested(suggested)
Parameters:

suggested (AppStream.Suggested) – The AppStream.Suggested

Add an AppStream.Suggested to this component.

add_tag(ns, tag)
Parameters:
  • ns (str) – The namespace the tag belongs to

  • tag (str) – The tag name

Returns:

True if the tag was added.

Return type:

bool

Add a tag to this component.

New in version 0.15.0.

add_translation(tr)
Parameters:

tr (AppStream.Translation) – an AppStream.Translation instance.

Assign an AppStream.Translation object describing the translation system used by this component.

New in version 0.9.2.

add_url(url_kind, url)
Parameters:

Adds some URL data to the component.

New in version 0.6.2.

check_relations(sysinfo, pool, rel_kind)
Parameters:
Returns:

An array of AppStream.RelationCheckResult

Return type:

[AppStream.RelationCheckResult]

Verifies the respective relations and presents whether the system specified in AppStream.SystemInfo sysinfo and data from pool supply the requested facilities.

New in version 1.0.0.

clear_keywords(locale)
Parameters:

locale (str or None) – BCP47 locale of the values, or None to use current locale.

Remove all keywords for the given locale.

clear_languages()

Remove all registered language translation information.

New in version 0.14.5.

clear_tags()

Remove all tags associated with this component.

New in version 0.15.0.

get_addons()
Returns:

An array of AppStream.Component.

Return type:

[AppStream.Component]

Returns a list of AppStream.Component objects which are addons extending this component in functionality.

This is the reverse of AppStream.Component.get_extends()

New in version 0.9.2.

get_agreement_by_kind(kind)
Parameters:

kind (AppStream.AgreementKind) – an agreement kind, e.g. AppStream.AgreementKind.EULA

Returns:

a AppStream.Agreement or None for not found

Return type:

AppStream.Agreement or None

Gets an agreement the component has specified for the particular kind.

New in version 0.12.1.

get_agreements()
Returns:

An array of AppStream.Agreement.

Return type:

[AppStream.Agreement]

Get a list of all agreements registered with this software component.

New in version 0.15.0.

get_branch()
Returns:

string, or None if unset

Return type:

str

Gets the branch for the application.

New in version 0.14.0.

get_branding()
Returns:

An AppStream.Branding.

Return type:

AppStream.Branding or None

Get the branding associated with this component, or None in case this component has no special branding.

New in version 0.15.2.

get_bundle(bundle_kind)
Parameters:

bundle_kind (AppStream.BundleKind) – the bundle kind, e.g. AppStream.BundleKind.LIMBA.

Returns:

An AppStream.Bundle, or None if not set.

Return type:

AppStream.Bundle or None

Gets a bundle identifier string.

New in version 0.8.0.

get_bundles()
Returns:

A list of AppStream.Bundle.

Return type:

[AppStream.Bundle]

Get a list of all software bundles associated with this component.

New in version 0.10.

get_categories()
Returns:

String array of categories

Return type:

[str]

get_compulsory_for_desktops()
Returns:

A list of desktops where this component is compulsory

Return type:

[str]

get_content_rating(kind)
Parameters:

kind (str) – a ratings kind, e.g. “oars-1.0”

Returns:

a AppStream.ContentRating or None if not found

Return type:

AppStream.ContentRating or None

Gets a content ratings of a specific type that are defined for this component.

New in version 0.11.0.

get_content_ratings()
Returns:

an array

Return type:

[AppStream.ContentRating]

Gets all content ratings defined for this software.

New in version 0.11.0.

get_context()
Returns:

the associated AppStream.Context or None

Return type:

AppStream.Context or None

Get the AppStream.Context associated with this component. This function may return None if no context is set (which will be the case if the component was not loaded from a file or cache but constructed in memory).

New in version 0.11.2.

get_custom()
Returns:

Hash table of custom user defined data fields.

Return type:

{object: object}

New in version 0.10.5.

get_custom_value(key)
Parameters:

key (str) – Field name.

Return type:

str

Retrieve value for a custom data entry with the given key.

New in version 0.10.5.

get_data_id()
Returns:

the unique session-specific identifier.

Return type:

str

Get a unique identifier for this metadata set. This unique ID is only valid for the current session, as opposed to the AppStream ID which uniquely identifies a software component.

The format of the unique id usually is: %{scope}/%{origin}/%{distribution_system}/%{appstream_id}

For example: system/os/package/org.example.FooBar

get_date_eol()
Returns:

The EOL date as string in ISO8601 format.

Return type:

str

Gets the end-of-life date for the entire component.

New in version 0.15.2.

get_description()
Returns:

the description.

Return type:

str

Get the localized long description of this component.

get_developer()
Returns:

the developer as AppStream.Developer.

Return type:

AppStream.Developer

Get information about the component’s developer or development team. The returned object may be empty if no developer information was available.

get_extends()
Returns:

A GLib.PtrArray or None if not set.

Return type:

[str] or None

Returns a string list of IDs of components which are extended by this addon.

See AppStream.Component.get_extends() for the reverse.

New in version 0.15.5.

get_icon_by_size(width, height)
Parameters:
  • width (int) – The icon width in pixels.

  • height (int) – the icon height in pixels.

Returns:

An icon matching the given width/height, or None if not found.

Return type:

AppStream.Icon or None

Gets an icon matching the size constraints. The icons are not filtered by type, and the first icon which matches the size is returned. If you want more control over which icons you use for displaying, use the AppStream.Component.get_icons() function to get a list of all icons.

Note that this function is not HiDPI aware! It will never return an icon with a scaling factor > 1.

get_icon_stock()
Returns:

An stock icon, or None if none found.

Return type:

AppStream.Icon or None

Gets a stock icon for this component if one is associated with it. Will return None otherwise.

get_icons()
Returns:

A GLib.PtrArray of all icons for this component.

Return type:

[AppStream.Icon]

get_id()
Returns:

the unique AppStream identifier.

Return type:

str

Get the unique AppStream identifier for this component. This ID is unique for the described component, but does not uniquely identify the metadata set.

For a unique ID for this metadata set in the current session, use AppStream.Component.get_data_id()

get_keywords()
Returns:

String array of keywords

Return type:

[str]

get_keywords_table()
Returns:

Hash table locale->keyword arrays

Return type:

{object: object}

Retrieve the internal hash table mapping languages to keword arrays.

get_kind()
Returns:

the kind of #this.

Return type:

AppStream.ComponentKind

Returns the AppStream.ComponentKind of this component.

get_language(locale)
Parameters:

locale (str or None) – the BCP47 locale, or None. e.g. “en-GB”

Returns:

a percentage value, -1 if locale was not found

Return type:

int

Gets the translation coverage in percent for a specific locale

New in version 0.7.0.

get_languages()
Returns:

list of locales

Return type:

[str]

Get a list of all languages.

New in version 0.7.0.

get_launchable(kind)
Parameters:

kind (AppStream.LaunchableKind) – a launch kind, e.g. AppStream.LaunchableKind.DESKTOP_ID

Returns:

a AppStream.Launchable or None if not found

Return type:

AppStream.Launchable or None

Gets a AppStream.Launchable of a specific type that contains launchable entries for this component.

New in version 0.11.0.

get_launchables()
Returns:

an array

Return type:

[AppStream.Launchable]

New in version 0.11.0.

get_merge_kind()
Returns:

the AppStream.MergeKind of this component.

Return type:

AppStream.MergeKind

Get the merge method which should apply to duplicate components with this ID.

New in version 0.9.8.

get_metadata_license()
Returns:

the license.

Return type:

str

The license the metadata iself is subjected to.

get_name()
Returns:

the name.

Return type:

str

A human-readable name for this component.

get_name_table()
Returns:

locale->names map

Return type:

{object: object}

Get the internal locale to component name mapping table.

get_name_variant_suffix()
Returns:

the variant suffix

Return type:

str

Get variant suffix for the component name (only to be displayed if two components have the same name).

New in version 0.12.10.

get_origin()
Return type:

str

get_pkgname()
Returns:

String array of package names

Return type:

str

Get the first package name of the list of packages that need to be installed for this component to be present on the system. Since most components consist of only one package, this is safe to use for about 90% of all cases.

However, to support a component fully, please use AppStream.Component.get_pkgnames() for getting all packages that need to be installed, and use this method only to e.g. get the main package to perform a quick “is it installed?” check.

get_pkgnames()
Returns:

String array of package names

Return type:

[str]

Get a list of package names which this component consists of. This usually is just one package name.

get_priority()
Return type:

int

Returns the priority of this component. This method is used internally.

New in version 0.6.1.

get_project_group()
Returns:

the project group.

Return type:

str

Get the component’s project group.

get_project_license()
Returns:

the license.

Return type:

str

Get the license of the project this component belongs to.

get_provided()
Returns:

A list of AppStream.Provided objects.

Return type:

[AppStream.Provided]

Get a list of AppStream.Provided objects associated with this component.

get_provided_for_kind(kind)
Parameters:

kind (AppStream.ProvidedKind) – kind of the provided item, e.g. AppStream.ProvidedKind.MEDIATYPE

Returns:

AppStream.Provided containing the items this component provides, or None.

Return type:

AppStream.Provided or None

Get an AppStream.Provided object for the given interface type, containing information about the public interfaces (mimetypes, firmware, DBus services, …) this component provides.

get_recommends()
Returns:

an array

Return type:

[AppStream.Relation]

Get an array of items that are recommended by this component.

New in version 0.12.0.

get_references()
Returns:

An array of AppStream.Reference.

Return type:

[AppStream.Reference]

Get a list of external references and citation information for this component.

New in version 1.0.0.

get_releases_plain()
Returns:

Release information as AppStream.ReleaseList

Return type:

AppStream.ReleaseList

Get release information for this component, without downloading or loading any data from external sources.

get_replaces()
Returns:

an array of component-IDs

Return type:

[str]

Get a list of component IDs of components that this software replaces entirely.

get_requires()
Returns:

an array

Return type:

[AppStream.Relation]

Get an array of items that are required by this component.

New in version 0.12.0.

get_reviews()
Returns:

an array

Return type:

[AppStream.Review]

Gets any reviews associated with the component.

New in version 0.14.0.

get_scope()
Returns:

the AppStream.ComponentScope of this component.

Return type:

AppStream.ComponentScope

New in version 0.10.2.

get_screenshots_all()
Returns:

an array of AppStream.Screenshot instances

Return type:

[AppStream.Screenshot]

Get a list of all associated screenshots, for all environments.

get_search_tokens()
Returns:

The string search tokens

Return type:

[str]

Returns all search tokens for this component.

New in version 0.9.7.

get_sort_score()
Return type:

int

Returns the sorting priority of this component.

This will only return a valid value if this component was the result of or involved in a search operation which returned sorted results. In most cases you will not need to access this value explicitly, as all results of search operations in AppStream are already sorted from best match to worst.

The returned value is an arbitrary integer value, valid only for the search terms involved in the search operation that yielded this component as a result.

New in version 0.12.11.

get_source_pkgname()
Returns:

the source package name.

Return type:

str

get_suggested()
Returns:

an array of AppStream.Suggested instances

Return type:

[AppStream.Suggested]

Get a list of associated suggestions.

get_summary()
Returns:

the summary.

Return type:

str

Get a short description of this component.

get_summary_table()
Returns:

locale->summary map

Return type:

{object: object}

Get the internal locale to component summary mapping table.

get_supports()
Returns:

an array

Return type:

[AppStream.Relation]

Get an array of items that are supported by this component, e.g. to indicate support for a specific piece of hardware.

New in version 0.15.0.

get_system_compatibility_score(sysinfo, is_template)
Parameters:
Returns:

a compatibility score between 0 and 100

results:

Receive the resulting check results

Return type:

(int, results: [AppStream.RelationCheckResult])

Return a score between 0 and 100 determining how compatible the component is with the system configuration provided as parameter.

0 means the componsnt will not work at all, while 100 is best compatibility.

get_timestamp_eol()
Returns:

UNIX timestamp, or 0 for unset or invalid.

Return type:

int

Gets the UNIX timestamp for the date when this component is out of support (end-of-life) and will receive no more updates, not even security fixes.

New in version 0.15.2.

get_translations()
Returns:

An array of AppStream.Translation objects.

Return type:

[AppStream.Translation]

Get a GLib.PtrArray of AppStream.Translation objects describing the translation systems and translation-ids (e.g. Gettext domains) used by this software component.

Only set for metainfo files.

New in version 0.9.2.

get_url(url_kind)
Parameters:

url_kind (AppStream.UrlKind) – the URL kind, e.g. AppStream.UrlKind.HOMEPAGE.

Returns:

string, or None if unset

Return type:

str or None

Gets a URL.

New in version 0.6.2.

has_bundle()
Returns:

True if this component has a bundle associated.

Return type:

bool

has_category(category)
Parameters:

category (str) – the specified category to check

Returns:

True if the component is in the specified category.

Return type:

bool

Check if component is in the specified category.

has_tag(ns, tag)
Parameters:
  • ns (str) – The namespace the tag belongs to

  • tag (str) – The tag name

Returns:

True if tag exists.

Return type:

bool

Test if the component is tagged with the selected tag.

New in version 0.15.0.

insert_custom_value(key, value)
Parameters:
  • key (str) – Key name.

  • value (str) – A string value.

Returns:

True if the key did not exist yet.

Return type:

bool

Add a key and value pair to the custom data table.

New in version 0.10.5.

is_compulsory_for_desktop(desktop)
Parameters:

desktop (str) – the desktop-id to test for

Returns:

True if compulsory, False otherwise.

Return type:

bool

Check if this component is compulsory for the given desktop.

is_floss()
Returns:

True if this component is free software.

Return type:

bool

Returns True if this component is free and open source software. To determine this status, this function will check if it comes from a vetted free-software-only source or whether its licenses are only free software licenses.

New in version 0.15.5.

is_ignored()
Returns:

Whether this component’s metadata should be ignored.

Return type:

bool

New in version 0.10.2.

is_member_of_category(category)
Parameters:

category (AppStream.Category) – The category to test.

Return type:

bool

Test if the component self is a member of category category.

is_valid()
Returns:

True if the component data was validated successfully.

Return type:

bool

Check if the essential properties of this Component are populated with useful data.

load_from_bytes(context, format, bytes)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Load metadata for this component from an XML string. You normally do not want to use this method directly and instead use the more convenient API of AppStream.Metadata to create and update components.

If this function returns True, a valid component is returned unless the selected format was AppStream.FormatKind.DESKTOP_ENTRY, in which case a component ID will have to be set explicitly by the caller in order to make the component valid.

New in version 0.14.0.

load_releases(allow_net)
Parameters:

allow_net (bool) –

Raises:

GLib.Error

Returns:

Release information as AppStream.ReleaseList, or None if loading failed.

Return type:

AppStream.ReleaseList or None

Get release information for this component, download it if necessary.

remove_tag(ns, tag)
Parameters:
  • ns (str) – The namespace the tag belongs to

  • tag (str) – The tag name

Returns:

True if the tag was removed.

Return type:

bool

Remove a tag from this component

New in version 0.15.0.

search_matches(term)
Parameters:

term (str) – the search term.

Returns:

a match scrore, where 0 is no match and 100 is the best match.

Return type:

int

Searches component data for a specific keyword.

New in version 0.9.7.

search_matches_all(terms)
Parameters:

terms (str) – the search terms.

Returns:

a match score, where 0 is no match and larger numbers are better matches.

Return type:

int

Searches component data for all the specific keywords.

New in version 0.9.8.

set_branch(branch)
Parameters:

branch (str) – the branch, e.g. “master” or “3-16”.

Set the branch that the component instance was sourced from.

New in version 0.14.0.

set_branding(branding)
Parameters:

branding (AppStream.Branding) – an AppStream.Branding instance.

Set branding for this component.

New in version 0.15.2.

set_compulsory_for_desktop(desktop)
Parameters:

desktop (str) – The name of the desktop.

Mark this component to be compulsory for the specified desktop environment.

set_context(context)
Parameters:

context (AppStream.Context) – the AppStream.Context.

Sets the document context this component is associated with.

New in version 0.11.2.

set_context_locale(locale)
Parameters:

locale (str) – the new locale.

Set the active locale on the context assoaiacted with this component, creating a new context for the component if none exists yet.

Please not that this will flip the locale of all other components and entities that use the same context as well! This function is just a convenience method, and does not replace proper AppStream.Context management.

set_data_id(value)
Parameters:

value (str) – the unique session-specific identifier.

Set the session-specific unique metadata identifier for this component. If two components have a different data_id but the same ID, they will be treated as independent sets of metadata describing the same component type.

set_date_eol(date)
Parameters:

date (str) – the EOL date in ISO8601 format.

Sets an end-of-life date for this component.

New in version 0.15.2.

set_description(value, locale)
Parameters:
  • value (str) – The long description

  • locale (str or None) – The BCP47 locale for this value, or None to use the current active one.

Set long description for this component.

set_developer(developer)
Parameters:

developer (AppStream.Developer) – the new AppStream.Developer

Set the the component’s developer.

set_id(value)
Parameters:

value (str) – the unique identifier.

Set the AppStream identifier for this component.

set_keywords(new_keywords, locale, deep_copy)
Parameters:
  • new_keywords ([str]) – Array of keywords

  • locale (str or None) – BCP47 locale of the values, or None to use current locale.

  • deep_copy (bool) – Set to True if the keywords array should be copied, False to set by reference.

Set keywords for this component, replacing all existing ones for the selected locale.

set_kind(value)
Parameters:

value (AppStream.ComponentKind) – the AppStream.ComponentKind.

Sets the AppStream.ComponentKind of this component.

set_merge_kind(kind)
Parameters:

kind (AppStream.MergeKind) – the AppStream.MergeKind.

Sets the AppStream.MergeKind for this component.

New in version 0.9.8.

set_metadata_license(value)
Parameters:

value (str) – the metadata license.

Set the license this metadata is licensed under.

set_name(value, locale)
Parameters:
  • value (str) – The name

  • locale (str or None) – The BCP47 locale for this value, or None to use the current active one.

Set a human-readable name for this component.

set_name_variant_suffix(value, locale)
Parameters:
  • value (str) – the developer or developer team name

  • locale (str or None) – the BCP47 locale, or None. e.g. “en-GB”

Set a variant suffix for the component name (only to be displayed if components have the same name).

New in version 0.12.10.

set_origin(origin)
Parameters:

origin (str) – the origin.

set_pkgname(pkgname)
Parameters:

pkgname (str) – the package name

Set the package name that provides this component.

New in version 0.14.5.

set_pkgnames(packages)
Parameters:

packages ([str]) –

Set a list of package names this component consists of. (This should usually be just one package name)

set_priority(priority)
Parameters:

priority (int) – the given priority

Sets the priority of this component. This method is used internally.

New in version 0.6.1.

set_project_group(value)
Parameters:

value (str) – the project group.

Set the component’s project group.

set_project_license(value)
Parameters:

value (str) – the project license.

Set the project license.

set_releases(releases)
Parameters:

releases (AppStream.ReleaseList) – the AppStream.ReleaseList to use.

Set a new set of releases for this component.

set_scope(scope)
Parameters:

scope (AppStream.ComponentScope) – the AppStream.ComponentKind.

Sets the AppStream.ComponentScope of this component.

set_sort_score(score)
Parameters:

score (int) – the given sorting score

Sets the sorting score of this component.

New in version 0.9.8.

set_source_pkgname(spkgname)
Parameters:

spkgname (str) – the source package name.

set_summary(value, locale)
Parameters:
  • value (str) – The summary

  • locale (str or None) – The BCP47 locale for this value, or None to use the current active one.

Set a short description for this component.

sort_screenshots(environment, style, prioritize_style)
Parameters:
  • environment (str or None) – a GUI environment string, e.g. “plasma” or “gnome”

  • style (str or None) – and environment style string, e.g. “light” or “dark”

  • prioritize_style (bool) – if True, order screenshots of the given style earlier than ones of the given environment.

Reorder the screenshots to prioritize a certain environment or style, instead of using the default screenshot order.

If both “environment” and “style” are None, the previous default order is restored.

to_string()
Returns:

A descriptive string

Return type:

str

Returns a string identifying this component. (useful for debugging)

to_xml_data(context)
Parameters:

context (AppStream.Context) – an AppStream.Context instance.

Raises:

GLib.Error

Returns:

True on success.

Return type:

str

Serialize this component into an XML string. You normally do not want to use this method directly and instead use the more convenient API of AppStream.Metadata to serialize components.

New in version 0.12.10.

Property Details

AppStream.Component.props.categories
Name:

categories

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

string array of categories

AppStream.Component.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the description

AppStream.Component.props.icons
Name:

icons

Type:

int

Default Value:

None

Flags:

READABLE

hash map of icon urls and sizes

AppStream.Component.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the unique identifier

AppStream.Component.props.keywords
Name:

keywords

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

string array of keywords

AppStream.Component.props.kind
Name:

kind

Type:

AppStream.ComponentKind

Default Value:

AppStream.ComponentKind.UNKNOWN

Flags:

READABLE, WRITABLE

the AppStream.ComponentKind of this component

AppStream.Component.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the name

AppStream.Component.props.pkgnames
Name:

pkgnames

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

string array of packages name

AppStream.Component.props.project_group
Name:

project-group

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the project group

AppStream.Component.props.project_license
Name:

project-license

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the project license

AppStream.Component.props.screenshots
Name:

screenshots

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

An array of AppStream.Screenshot instances

AppStream.Component.props.summary
Name:

summary

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the summary

AppStream.Component.props.urls
Name:

urls

Type:

GLib.HashTable

Default Value:

None

Flags:

READABLE

the urls associated with this component