AppStreamGlib.App

g AppStreamGlib.App AppStreamGlib.App GObject.Object GObject.Object GObject.Object->AppStreamGlib.App

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

class

guess_source_kind (filename)

class

kind_from_string (kind)

class

kind_to_string (kind)

class

merge_kind_from_string (merge_kind)

class

merge_kind_to_string (merge_kind)

class

new ()

class

scope_from_string (scope)

class

scope_to_string (scope)

class

source_kind_from_string (source_kind)

class

source_kind_to_string (source_kind)

class

state_to_string (state)

add_addon (addon)

add_agreement (agreement)

add_arch (arch)

add_bundle (bundle)

add_category (category)

add_compulsory_for_desktop (compulsory_for_desktop)

add_content_rating (content_rating)

add_extends (extends)

add_format (format)

add_icon (icon)

add_keyword (locale, keyword)

add_kudo (kudo)

add_kudo_kind (kudo_kind)

add_language (percentage, locale)

add_launchable (launchable)

add_metadata (key, value)

add_mimetype (mimetype)

add_permission (permission)

add_pkgname (pkgname)

add_provide (provide)

add_quirk (quirk)

add_release (release)

add_require (require)

add_review (review)

add_screenshot (screenshot)

add_suggest (suggest)

add_translation (translation)

add_url (url_kind, url)

convert_icons (kind)

equal (app2)

get_addons ()

get_agreement_by_kind (kind)

get_agreement_default ()

get_architectures ()

get_branch ()

get_bundle_default ()

get_bundles ()

get_categories ()

get_comment (locale)

get_comments ()

get_compulsory_for_desktops ()

get_content_rating (kind)

get_content_ratings ()

get_description (locale)

get_descriptions ()

get_developer_name (locale)

get_developer_names ()

get_extends ()

get_format_by_filename (filename)

get_format_by_kind (kind)

get_format_default ()

get_formats ()

get_icon_default ()

get_icon_for_size (width, height)

get_icon_path ()

get_icons ()

get_id ()

get_id_filename ()

get_id_kind ()

get_id_no_prefix ()

get_keywords (locale)

get_kind ()

get_kudos ()

get_language (locale)

get_languages ()

get_launchable_by_kind (kind)

get_launchable_default ()

get_launchables ()

get_merge_kind ()

get_metadata ()

get_metadata_item (key)

get_metadata_license ()

get_mimetypes ()

get_name (locale)

get_names ()

get_origin ()

get_permissions ()

get_pkgname_default ()

get_pkgnames ()

get_priority ()

get_project_group ()

get_project_license ()

get_provides ()

get_release (version)

get_release_by_version (version)

get_release_default ()

get_releases ()

get_require_by_value (kind, value)

get_requires ()

get_reviews ()

get_scope ()

get_screenshot_default ()

get_screenshots ()

get_search_match ()

get_source_file ()

get_source_kind ()

get_source_pkgname ()

get_state ()

get_suggests ()

get_translations ()

get_trust_flags ()

get_unique_id ()

get_update_contact ()

get_url_item (url_kind)

get_urls ()

get_vetos ()

has_category (category)

has_compulsory_for_desktop (desktop)

has_kudo (kudo)

has_kudo_kind (kudo)

has_permission (permission)

has_quirk (quirk)

parse_data (data, flags)

parse_file (filename, flags)

remove_category (category)

remove_format (format)

remove_kudo (kudo)

remove_metadata (key)

remove_veto (description)

search_matches (search)

search_matches_all (search)

set_branch (branch)

set_comment (locale, comment)

set_description (locale, description)

set_developer_name (locale, developer_name)

set_icon_path (icon_path)

set_id (id)

set_id_kind (id_kind)

set_kind (kind)

set_merge_kind (merge_kind)

set_metadata_license (metadata_license)

set_name (locale, name)

set_origin (origin)

set_priority (priority)

set_project_group (project_group)

set_project_license (project_license)

set_scope (scope)

set_search_match (search_match)

set_source_file (source_file)

set_source_kind (source_kind)

set_source_pkgname (source_pkgname)

set_state (state)

set_trust_flags (trust_flags)

set_update_contact (update_contact)

subsume (donor)

subsume_full (donor, flags)

to_file (file, cancellable)

to_xml ()

validate (flags)

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

GObject.Object

Abstract:

No

Structure:

AppStreamGlib.AppClass

classmethod error_quark()[source]
Returns:

An error quark.

Return type:

int

New in version 0.1.2.

classmethod guess_source_kind(filename)[source]
Parameters:

filename (str) – a file name

Returns:

A AppStreamGlib.FormatKind, e.g. AppStreamGlib.FormatKind.APPSTREAM.

Return type:

AppStreamGlib.FormatKind

Guesses the source kind based from the filename.

New in version 0.1.8.

classmethod kind_from_string(kind)[source]
Parameters:

kind (str) – the string.

Returns:

a AppStreamGlib.AppKind or AppStreamGlib.AppKind.UNKNOWN for unknown

Return type:

AppStreamGlib.AppKind

Converts the text representation to an enumerated value.

New in version 0.5.10.

classmethod kind_to_string(kind)[source]
Parameters:

kind (AppStreamGlib.AppKind) – the AppStreamGlib.AppKind.

Returns:

string version of kind

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.5.10.

classmethod merge_kind_from_string(merge_kind)[source]
Parameters:

merge_kind (str) – a source kind string

Returns:

A AppStreamGlib.AppMergeKind, e.g. AppStreamGlib.AppMergeKind.REPLACE.

Return type:

AppStreamGlib.AppMergeKind

Converts the text representation to an enumerated value.

New in version 0.6.1.

classmethod merge_kind_to_string(merge_kind)[source]
Parameters:

merge_kind (AppStreamGlib.AppMergeKind) – the AppStreamGlib.AppMergeKind, e.g. AppStreamGlib.AppMergeKind.REPLACE

Returns:

string version of merge_kind, or None for unknown

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.6.1.

classmethod new()[source]
Returns:

a AppStreamGlib.App

Return type:

AppStreamGlib.App

Creates a new AppStreamGlib.App.

New in version 0.1.0.

classmethod scope_from_string(scope)[source]
Parameters:

scope (str) – a source kind string

Returns:

A AppStreamGlib.AppScope, e.g. AppStreamGlib.AppScope.SYSTEM.

Return type:

AppStreamGlib.AppScope

Converts the text representation to an enumerated value.

New in version 0.6.1.

classmethod scope_to_string(scope)[source]
Parameters:

scope (AppStreamGlib.AppScope) – the AppStreamGlib.AppScope, e.g. AppStreamGlib.AppScope.SYSTEM

Returns:

string version of scope, or None for unknown

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.6.1.

classmethod source_kind_from_string(source_kind)[source]
Parameters:

source_kind (str) – a source kind string

Returns:

A AppStreamGlib.FormatKind, e.g. AppStreamGlib.FormatKind.APPSTREAM.

Return type:

AppStreamGlib.FormatKind

Converts the text representation to an enumerated value.

New in version 0.2.2.

classmethod source_kind_to_string(source_kind)[source]
Parameters:

source_kind (AppStreamGlib.FormatKind) – the AppStreamGlib.FormatKind.

Returns:

string version of source_kind, or None for unknown

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.2.2.

classmethod state_to_string(state)[source]
Parameters:

state (AppStreamGlib.AppState) – the AppStreamGlib.AppState.

Returns:

string version of state, or None for unknown

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.2.2.

add_addon(addon)[source]
Parameters:

addon (AppStreamGlib.App) – a AppStreamGlib.App instance.

Adds a addon to an application.

New in version 0.1.7.

add_agreement(agreement)[source]
Parameters:

agreement (AppStreamGlib.Agreement) – a AppStreamGlib.Agreement instance.

Adds a agreement to an application.

New in version 0.7.8.

add_arch(arch)[source]
Parameters:

arch (str) – the package name.

Adds a package name to an application.

New in version 0.1.1.

add_bundle(bundle)[source]
Parameters:

bundle (AppStreamGlib.Bundle) – a AppStreamGlib.Bundle instance.

Adds a bundle to an application.

New in version 0.3.5.

add_category(category)[source]
Parameters:

category (str) – the category.

Adds a menu category to the application.

New in version 0.1.0.

add_compulsory_for_desktop(compulsory_for_desktop)[source]
Parameters:

compulsory_for_desktop (str) – the desktop string, e.g. “GNOME”.

Adds a desktop that requires this application to be installed.

New in version 0.1.0.

add_content_rating(content_rating)[source]
Parameters:

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

Adds a content_rating to an application.

New in version 0.5.12.

add_extends(extends)[source]
Parameters:

extends (str) – the full ID, e.g. “eclipse.desktop”.

Adds a parent ID to the application.

New in version 0.1.7.

add_format(format)[source]
Parameters:

format (AppStreamGlib.Format) – the AppStreamGlib.Format.

Add a format the application has been built from.

New in version 0.6.9.

add_icon(icon)[source]
Parameters:

icon (AppStreamGlib.Icon) – a AppStreamGlib.Icon instance.

Adds a icon to an application.

New in version 0.3.1.

add_keyword(locale, keyword)[source]
Parameters:
  • locale (str or None) – the locale. e.g. “en_GB”

  • keyword (str) – the keyword.

Add a keyword the application should match against.

New in version 0.3.0.

add_kudo(kudo)[source]
Parameters:

kudo (str) – the kudo.

Add a kudo the application has obtained.

New in version 0.2.2.

add_kudo_kind(kudo_kind)[source]
Parameters:

kudo_kind (AppStreamGlib.KudoKind) – the AppStreamGlib.KudoKind.

Add a kudo the application has obtained.

New in version 0.2.2.

add_language(percentage, locale)[source]
Parameters:
  • percentage (int) – the percentage completion of the translation, or 0 for unknown

  • locale (str or None) – the locale. e.g. “en_GB”

Adds a language to the application.

New in version 0.1.0.

add_launchable(launchable)[source]
Parameters:

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

Adds a launchable to an application.

New in version 0.6.13.

add_metadata(key, value)[source]
Parameters:
  • key (str) – the metadata key.

  • value (str or None) – the value to store.

Adds a metadata entry to the application.

New in version 0.1.0.

add_mimetype(mimetype)[source]
Parameters:

mimetype (str) – the mimetype.

Adds a mimetype the application can process.

New in version 0.1.0.

add_permission(permission)[source]
Parameters:

permission (str) – the permission.

Add a permission the application has obtained.

New in version 0.3.5.

add_pkgname(pkgname)[source]
Parameters:

pkgname (str) – the package name.

Adds a package name to an application.

New in version 0.1.0.

add_provide(provide)[source]
Parameters:

provide (AppStreamGlib.Provide) – a AppStreamGlib.Provide instance.

Adds a provide to an application.

New in version 0.1.6.

add_quirk(quirk)[source]
Parameters:

quirk (AppStreamGlib.AppQuirk) – the AppStreamGlib.AppQuirk, e.g. AppStreamGlib.AppQuirk.PROVENANCE

Adds a specific attribute to an application.

New in version 0.5.10.

add_release(release)[source]
Parameters:

release (AppStreamGlib.Release) – a AppStreamGlib.Release instance.

Adds a release to an application.

New in version 0.1.0.

add_require(require)[source]
Parameters:

require (AppStreamGlib.Require) – a AppStreamGlib.Require instance.

Adds a require to an application.

New in version 0.6.7.

add_review(review)[source]
Parameters:

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

Adds a review to an application.

New in version 0.6.1.

add_screenshot(screenshot)[source]
Parameters:

screenshot (AppStreamGlib.Screenshot) – a AppStreamGlib.Screenshot instance.

Adds a screenshot to an application.

New in version 0.1.0.

add_suggest(suggest)[source]
Parameters:

suggest (AppStreamGlib.Suggest) – a AppStreamGlib.Suggest instance.

Adds a suggest to an application.

New in version 0.6.1.

add_translation(translation)[source]
Parameters:

translation (AppStreamGlib.Translation) – a AppStreamGlib.Translation instance.

Adds a translation to an application.

New in version 0.5.8.

add_url(url_kind, url)[source]
Parameters:

Adds some URL data to the application.

New in version 0.1.0.

convert_icons(kind)[source]
Parameters:

kind (AppStreamGlib.IconKind) – the AppStreamGlib.IconKind, e.g. AppStreamGlib.IconKind.EMBEDDED.

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Converts all the icons in the application to a specific kind.

New in version 0.3.1.

equal(app2)[source]
Parameters:

app2 (AppStreamGlib.App) – another AppStreamGlib.App instance.

Returns:

True if the applications are equal

Return type:

bool

Compare one application with another for equality using the following properties:

scope, e.g. system or user

bundle kind, e.g. package or flatpak

origin, e.g. fedora or gnome-apps-nightly

kind, e.g. app or runtime

AppStream ID, e.g. gimp.desktop

branch, e.g. stable or master

New in version 0.6.1.

get_addons()[source]
Returns:

an array

Return type:

[AppStreamGlib.App]

Gets all the addons the application has.

New in version 0.1.7.

get_agreement_by_kind(kind)[source]
Parameters:

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

Returns:

a AppStreamGlib.Agreement or None for not found

Return type:

AppStreamGlib.Agreement

Gets a agreement the application has defined of a specific type.

New in version 0.7.8.

get_agreement_default()[source]
Returns:

a AppStreamGlib.Agreement or None for not found

Return type:

AppStreamGlib.Agreement

Gets a privacy policys the application has defined of a specific type.

New in version 0.7.8.

get_architectures()[source]
Returns:

an array

Return type:

[str]

Gets the supported architectures for the application, or an empty list if all architectures are supported.

New in version 0.1.1.

get_branch()[source]
Returns:

string, or None if unset

Return type:

str

Gets the branch for the application.

New in version 0.6.1.

get_bundle_default()[source]
Returns:

a AppStreamGlib.Bundle, or None

Return type:

AppStreamGlib.Bundle

Finds the default bundle.

New in version 0.3.5.

get_bundles()[source]
Returns:

an array

Return type:

[AppStreamGlib.Bundle]

Gets any bundles the application has defined.

New in version 0.3.5.

get_categories()[source]
Returns:

an array

Return type:

[str]

Get the application categories.

New in version 0.1.0.

get_comment(locale)[source]
Parameters:

locale (str or None) – the locale. e.g. “en_GB”

Returns:

string, or None if unset

Return type:

str

Gets the application summary for a specific locale.

New in version 0.1.0.

get_comments()[source]
Returns:

hash table of comments

Return type:

{object: object}

Gets the comments set for the application.

New in version 0.1.6.

get_compulsory_for_desktops()[source]
Returns:

an array

Return type:

[str]

Returns the desktops where this application is compulsory.

New in version 0.1.0.

get_content_rating(kind)[source]
Parameters:

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

Returns:

a AppStreamGlib.ContentRating or None for not found

Return type:

AppStreamGlib.ContentRating

Gets a content ratings the application has defined of a specific type.

New in version 0.5.12.

get_content_ratings()[source]
Returns:

an array

Return type:

[AppStreamGlib.ContentRating]

Gets any content_ratings the application has defined.

New in version 0.5.12.

get_description(locale)[source]
Parameters:

locale (str or None) – the locale. e.g. “en_GB”

Returns:

string, or None if unset

Return type:

str

Gets the application description markup for a specific locale.

New in version 0.1.0.

get_descriptions()[source]
Returns:

hash table of descriptions

Return type:

{object: object}

Gets the descriptions set for the application.

New in version 0.1.6.

get_developer_name(locale)[source]
Parameters:

locale (str or None) – the locale. e.g. “en_GB”

Returns:

string, or None if unset

Return type:

str

Gets the application developer name for a specific locale.

New in version 0.1.8.

get_developer_names()[source]
Returns:

hash table of developer_names

Return type:

{object: object}

Gets the developer_names set for the application.

New in version 0.1.8.

get_extends()[source]
Returns:

an array

Return type:

[str]

Gets the IDs that are extended from the addon.

New in version 0.1.7.

get_format_by_filename(filename)[source]
Parameters:

filename (str) – a filename, e.g. “/home/hughsie/dave.desktop”

Returns:

A AppStreamGlib.Format, or None if not found

Return type:

AppStreamGlib.Format

Searches the list of formats for a specific filename.

New in version 0.6.9.

get_format_by_kind(kind)[source]
Parameters:

kind (AppStreamGlib.FormatKind) – a AppStreamGlib.FormatKind, e.g. AppStreamGlib.FormatKind.APPDATA

Returns:

A AppStreamGlib.Format, or None if not found

Return type:

AppStreamGlib.Format

Searches the list of formats for a specific format kind.

New in version 0.6.9.

get_format_default()[source]
Returns:

A AppStreamGlib.Format, or None if not found

Return type:

AppStreamGlib.Format

Returns the default format.

New in version 0.6.9.

get_formats()[source]
Returns:

an array

Return type:

[str]

Gets any formats that make up the application.

New in version 0.6.9.

get_icon_default()[source]
Returns:

a AppStreamGlib.Icon, or None

Return type:

AppStreamGlib.Icon

Finds the default icon.

New in version 0.3.1.

get_icon_for_size(width, height)[source]
Parameters:
  • width (int) – Size in pixels

  • height (int) – Size in pixels

Returns:

a AppStreamGlib.Icon, or None

Return type:

AppStreamGlib.Icon

Finds an icon of a specific size.

New in version 0.3.1.

get_icon_path()[source]
Returns:

string, or None if unset

Return type:

str

Gets the application icon path.

New in version 0.1.0.

get_icons()[source]
Returns:

an array

Return type:

[AppStreamGlib.Icon]

Gets any icons the application has defined.

New in version 0.3.1.

get_id()[source]
Returns:

the ID, e.g. “org.gnome.Software.desktop”

Return type:

str

Gets the full ID value.

New in version 0.1.0.

get_id_filename()[source]
Returns:

A utf8 filename

Return type:

str

Returns a filename which represents the applications ID, e.g. “gimp.desktop” becomes “gimp” and is used for cache directories.

New in version 0.3.0.

get_id_kind()[source]
Returns:

enumerated value

Return type:

AppStreamGlib.IdKind

Gets the ID kind.

New in version 0.1.0.

get_id_no_prefix()[source]
Returns:

the ID, e.g. “org.gnome.Software.desktop”

Return type:

str

Gets the full ID value, stripping any prefix.

New in version 0.5.12.

get_keywords(locale)[source]
Parameters:

locale (str or None) – the locale. e.g. “en_GB”

Returns:

an array, or None

Return type:

[str]

Gets any keywords the application should match against.

New in version 0.3.0.

get_kind()[source]
Returns:

enumerated value

Return type:

AppStreamGlib.AppKind

Gets the ID kind.

New in version 0.5.10.

get_kudos()[source]
Returns:

an array

Return type:

[str]

Gets any kudos the application has obtained.

New in version 0.2.2.

get_language(locale)[source]
Parameters:

locale (str or None) – the locale. e.g. “en_GB”

Returns:

a percentage value where 0 is unspecified, or -1 for not found

Return type:

int

Gets the language coverage for the specific language.

New in version 0.1.0.

get_languages()[source]
Returns:

list of language values

Return type:

[str]

Get a list of all languages.

New in version 0.1.0.

get_launchable_by_kind(kind)[source]
Parameters:

kind (AppStreamGlib.LaunchableKind) – a AppStreamGlib.LaunchableKind, e.g. AppStreamGlib.FormatKind.APPDATA

Returns:

A AppStreamGlib.Launchable, or None if not found

Return type:

AppStreamGlib.Launchable

Searches the list of launchables for a specific launchable kind.

New in version 0.6.13.

get_launchable_default()[source]
Returns:

A AppStreamGlib.Launchable, or None if not found

Return type:

AppStreamGlib.Launchable

Returns the default launchable.

New in version 0.6.13.

get_launchables()[source]
Returns:

an array

Return type:

[AppStreamGlib.Launchable]

Gets all the launchables the application has.

New in version 0.6.13.

get_merge_kind()[source]
Returns:

enumerated value

Return type:

AppStreamGlib.AppMergeKind

Gets the merge_kind of the application.

New in version 0.6.1.

get_metadata()[source]
Returns:

hash table of metadata

Return type:

{str: str}

Gets the metadata set for the application.

New in version 0.1.6.

get_metadata_item(key)[source]
Parameters:

key (str) – the metadata key.

Returns:

string, or None if unset

Return type:

str

Gets some metadata item.

New in version 0.1.0.

get_metadata_license()[source]
Returns:

string, or None if unset

Return type:

str

Gets the application project license.

New in version 0.1.4.

get_mimetypes()[source]
Returns:

an array

Return type:

[str]

Gets any mimetypes the application will register.

New in version 0.2.0.

get_name(locale)[source]
Parameters:

locale (str or None) – the locale. e.g. “en_GB”

Returns:

string, or None if unset

Return type:

str

Gets the application name for a specific locale.

New in version 0.1.0.

get_names()[source]
Returns:

hash table of names

Return type:

{object: object}

Gets the names set for the application.

New in version 0.1.6.

get_origin()[source]
Returns:

the origin string, or None if unset

Return type:

str

Gets the application origin.

New in version 0.3.2.

get_permissions()[source]
Returns:

an array

Return type:

[str]

Gets any permissions the application has obtained.

New in version 0.3.5.

get_pkgname_default()[source]
Returns:

string, or None if unset

Return type:

str

Gets the default package name.

New in version 0.2.0.

get_pkgnames()[source]
Returns:

an array

Return type:

[str]

Gets the package names (if any) for the application.

New in version 0.1.0.

get_priority()[source]
Returns:

priority value

Return type:

int

Gets the application priority. Larger values trump smaller values.

New in version 0.1.0.

get_project_group()[source]
Returns:

string, or None if unset

Return type:

str

Gets an application project group.

New in version 0.1.0.

get_project_license()[source]
Returns:

string, or None if unset

Return type:

str

Gets the application project license.

New in version 0.1.0.

get_provides()[source]
Returns:

an array

Return type:

[AppStreamGlib.Provide]

Gets all the provides the application has.

New in version 0.1.6.

get_release(version)[source]
Parameters:

version (str) – a version string

Returns:

a release, or None

Return type:

AppStreamGlib.Release

Gets a specific release from the application.

New in version 0.3.5.

get_release_by_version(version)[source]
Parameters:

version (str) – a release version number, e.g. “1.2.3”

Returns:

a release, or None

Return type:

AppStreamGlib.Release

Gets a specific release from the application.

New in version 0.7.3.

get_release_default()[source]
Returns:

a release, or None

Return type:

AppStreamGlib.Release

Gets the default (newest) release from the application.

New in version 0.3.5.

get_releases()[source]
Returns:

an array

Return type:

[AppStreamGlib.Release]

Gets all the releases the application has had.

New in version 0.1.0.

get_require_by_value(kind, value)[source]
Parameters:
Returns:

A AppStreamGlib.Require, or None for not found

Return type:

AppStreamGlib.Require

Gets a specific requirement for the application.

New in version 0.6.7.

get_requires()[source]
Returns:

an array

Return type:

[AppStreamGlib.Require]

Gets any requires the application has defined. A requirement could be that a firmware version has to be below a defined version or that another application is required to be installed.

New in version 0.6.7.

get_reviews()[source]
Returns:

an array

Return type:

[AppStreamGlib.Screenshot]

Gets any reviews the application has defined.

New in version 0.6.1.

get_scope()[source]
Returns:

enumerated value

Return type:

AppStreamGlib.AppScope

Gets the scope of the application.

New in version 0.6.1.

get_screenshot_default()[source]
Returns:

a screenshot or None

Return type:

AppStreamGlib.Screenshot

Gets the default screenshot for the component.

New in version 0.7.3.

get_screenshots()[source]
Returns:

an array

Return type:

[AppStreamGlib.Screenshot]

Gets any screenshots the application has defined.

New in version 0.1.0.

get_search_match()[source]
Returns:

a AppStreamGlib.AppSearchMatch, e.g. AppStreamGlib.AppSearchMatch.PKGNAME

Return type:

int

Gets the token match fields. The bitfield given here is used to choose what is included in the token cache.

New in version 0.6.13.

get_source_file()[source]
Returns:

string, or None if unset

Return type:

str

Gets the default source filename the instance was populated from.

New in version 0.2.2.

get_source_kind()[source]
Returns:

enumerated value

Return type:

AppStreamGlib.FormatKind

Gets the source kind, i.e. where the AppStreamGlib.App came from.

New in version 0.1.4.

get_source_pkgname()[source]
Returns:

string, or None if unset

Return type:

str

Gets the source package name that produced the binary package. Only source packages producing more than one binary package will have this entry set.

New in version 0.2.4.

get_state()[source]
Returns:

enumerated value

Return type:

AppStreamGlib.AppState

Gets the application state.

New in version 0.2.2.

get_suggests()[source]
Returns:

an array

Return type:

[AppStreamGlib.Suggest]

Gets any suggests the application has defined.

New in version 0.6.1.

get_translations()[source]
Returns:

an array

Return type:

[AppStreamGlib.Translation]

Gets any translations the application has defined.

New in version 0.5.8.

get_trust_flags()[source]
Returns:

bitfield

Return type:

int

Gets the trust flags, i.e. how trusted the incoming data is.

New in version 0.2.2.

get_unique_id()[source]
Returns:

the unique ID, e.g. system/package/fedora/desktop/gimp.desktop/master

Return type:

str

Gets the unique ID value to represent the component.

New in version 0.6.1.

get_update_contact()[source]
Returns:

string, or None if unset

Return type:

str

Gets the application upstream update contact email.

New in version 0.1.4.

get_url_item(url_kind)[source]
Parameters:

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

Returns:

string, or None if unset

Return type:

str

Gets a URL.

New in version 0.1.0.

get_urls()[source]
Returns:

hash table of URLs

Return type:

{object: object}

Gets the URLs set for the application.

New in version 0.1.0.

get_vetos()[source]
Returns:

A list of vetos

Return type:

[str]

Gets the list of vetos.

New in version 0.2.5.

has_category(category)[source]
Parameters:

category (str) – a category string, e.g. “DesktopSettings”

Returns:

True if the application has got the specified category

Return type:

bool

Searches the category list for a specific item.

New in version 0.1.5.

has_compulsory_for_desktop(desktop)[source]
Parameters:

desktop (str) – a desktop string, e.g. “GNOME”

Returns:

True if the application is compulsory for a specific desktop

Return type:

bool

Searches the compulsory for desktop list for a specific item.

New in version 0.5.12.

has_kudo(kudo)[source]
Parameters:

kudo (str) – a kudo string, e.g. “SearchProvider”

Returns:

True if the application has got the specified kudo

Return type:

bool

Searches the kudo list for a specific item.

New in version 0.2.2.

has_kudo_kind(kudo)[source]
Parameters:

kudo (AppStreamGlib.KudoKind) – a AppStreamGlib.KudoKind, e.g. AppStreamGlib.KudoKind.SEARCH_PROVIDER

Returns:

True if the application has got the specified kudo

Return type:

bool

Searches the kudo list for a specific item.

New in version 0.2.2.

has_permission(permission)[source]
Parameters:

permission (str) – a permission string, e.g. “Network”

Returns:

True if the application has got the specified permission

Return type:

bool

Searches the permission list for a specific item.

New in version 0.3.5.

has_quirk(quirk)[source]
Parameters:

quirk (AppStreamGlib.AppQuirk) – the AppStreamGlib.AppQuirk, e.g. AppStreamGlib.AppQuirk.PROVENANCE

Returns:

True if the application has the attribute

Return type:

bool

Queries to see if an application has a specific attribute.

New in version 0.5.10.

parse_data(data, flags)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Parses an AppData file and populates the application state.

New in version 0.7.5.

parse_file(filename, flags)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Parses a desktop or AppData file and populates the application state.

Applications that are not suitable for the store will have vetos added.

New in version 0.1.2.

remove_category(category)[source]
Parameters:

category (str) – the category.

Removed a menu category from the application.

New in version 0.6.13.

remove_format(format)[source]
Parameters:

format (AppStreamGlib.Format) – the AppStreamGlib.Format.

Removes a format the application has been built from.

New in version 0.6.9.

remove_kudo(kudo)[source]
Parameters:

kudo (str) – the kudo.

Remove a kudo the application has obtained.

New in version 0.6.13.

remove_metadata(key)[source]
Parameters:

key (str) – the metadata key.

Removes a metadata item from the application.

New in version 0.1.0.

remove_veto(description)[source]
Parameters:

description (str) – veto string

Removes a reason to not include the application in the metadata.

New in version 0.4.1.

search_matches(search)[source]
Parameters:

search (str) – the search term.

Returns:

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

Return type:

int

Searches application data for a specific keyword.

New in version 0.1.0.

search_matches_all(search)[source]
Parameters:

search (str) – the search terms.

Returns:

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

It’s probably a good idea to use AppStreamGlib.utils_search_tokenize() to populate search as very short or common keywords will return a lot of matches.

Return type:

int

Searches application data for all the specific keywords.

New in version 0.1.3.

set_branch(branch)[source]
Parameters:

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

Set the branch that the instance was sourced from.

New in version 0.6.1.

set_comment(locale, comment)[source]
Parameters:
  • locale (str or None) – the locale. e.g. “en_GB”

  • comment (str) – the application summary.

Sets the application summary for a specific locale.

New in version 0.1.0.

set_description(locale, description)[source]
Parameters:
  • locale (str or None) – the locale. e.g. “en_GB”

  • description (str) – the application description.

Sets the application description markup for a specific locale.

New in version 0.1.0.

set_developer_name(locale, developer_name)[source]
Parameters:
  • locale (str or None) – the locale. e.g. “en_GB”

  • developer_name (str) – the application developer name.

Sets the application developer name for a specific locale.

New in version 0.1.0.

set_icon_path(icon_path)[source]
Parameters:

icon_path (str) – the local path.

Sets the icon path, where local icons would be found.

New in version 0.1.0.

set_id(id)[source]
Parameters:

id (str) – the new _full_ application ID, e.g. “org.gnome.Software.desktop”.

Sets a new application ID. Any invalid characters will be automatically replaced.

New in version 0.1.0.

set_id_kind(id_kind)[source]
Parameters:

id_kind (AppStreamGlib.IdKind) – the AppStreamGlib.AppKind.

Sets the application kind.

New in version 0.1.0.

set_kind(kind)[source]
Parameters:

kind (AppStreamGlib.AppKind) – the AppStreamGlib.AppKind.

Sets the application kind.

New in version 0.5.10.

set_merge_kind(merge_kind)[source]
Parameters:

merge_kind (AppStreamGlib.AppMergeKind) – the AppStreamGlib.AppMergeKind.

Sets the merge kind of the application.

New in version 0.6.1.

set_metadata_license(metadata_license)[source]
Parameters:

metadata_license (str) – the project license string.

Set the project license.

New in version 0.1.4.

set_name(locale, name)[source]
Parameters:
  • locale (str or None) – the locale. e.g. “en_GB”

  • name (str) – the application name.

Sets the application name for a specific locale.

New in version 0.1.0.

set_origin(origin)[source]
Parameters:

origin (str) – the origin, e.g. “fedora-21”

Sets the application origin.

New in version 0.3.2.

set_priority(priority)[source]
Parameters:

priority (int) – the priority.

Sets the application priority, where 0 is default and positive numbers are better than negative numbers.

New in version 0.1.0.

set_project_group(project_group)[source]
Parameters:

project_group (str) – the project group, e.g. “GNOME”.

Set any project affiliation.

New in version 0.1.0.

set_project_license(project_license)[source]
Parameters:

project_license (str) – the project license string.

Set the project license.

New in version 0.1.0.

set_scope(scope)[source]
Parameters:

scope (AppStreamGlib.AppScope) – the AppStreamGlib.AppScope.

Sets the scope of the application.

New in version 0.6.1.

set_search_match(search_match)[source]
Parameters:

search_match (int) – the AppStreamGlib.AppSearchMatch, e.g. AppStreamGlib.AppSearchMatch.PKGNAME

Sets the token match fields. The bitfield given here is used to choose what is included in the token cache.

New in version 0.6.13.

set_source_file(source_file)[source]
Parameters:

source_file (str) – the filename.

Set the file that the instance was sourced from.

New in version 0.2.2.

set_source_kind(source_kind)[source]
Parameters:

source_kind (AppStreamGlib.FormatKind) – the AppStreamGlib.FormatKind.

Sets the source kind.

New in version 0.1.4.

set_source_pkgname(source_pkgname)[source]
Parameters:

source_pkgname (str) – the project license string.

Set the project license.

New in version 0.2.4.

set_state(state)[source]
Parameters:

state (AppStreamGlib.AppState) – the AppStreamGlib.AppState.

Sets the application state.

New in version 0.2.2.

set_trust_flags(trust_flags)[source]
Parameters:

trust_flags (int) – the AppStreamGlib.AppTrustFlags.

Sets the check flags, where AppStreamGlib.AppTrustFlags.COMPLETE is completely trusted input.

New in version 0.2.2.

set_update_contact(update_contact)[source]
Parameters:

update_contact (str) – the project license string.

Set the project license.

New in version 0.1.4.

subsume(donor)[source]
Parameters:

donor (AppStreamGlib.App) – the donor.

Copies information from the donor to the application object.

New in version 0.1.0.

subsume_full(donor, flags)[source]
Parameters:

Copies information from the donor to the application object.

New in version 0.1.4.

to_file(file, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Exports a DOM tree to an XML file.

New in version 0.2.0.

to_xml()[source]
Raises:

GLib.Error

Returns:

an XML string, or None

Return type:

GLib.String

Exports a DOM tree to an XML string.

New in version 0.7.14.

validate(flags)[source]
Parameters:

flags (int) – the AppStreamGlib.AppValidateFlags to use, e.g. AppStreamGlib.AppValidateFlags.NONE

Raises:

GLib.Error

Returns:

A list of problems, or None

Return type:

[AppStreamGlib.Problem]

Validates data in the instance for style and consistency.

New in version 0.1.4.