AppStreamGlib.Release

g AppStreamGlib.Release AppStreamGlib.Release GObject.Object GObject.Object GObject.Object->AppStreamGlib.Release

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

kind_from_string (kind_str)

class

kind_to_string (kind)

class

new ()

class

state_from_string (state)

class

state_to_string (state)

add_checksum (checksum)

add_location (location)

get_blob (filename)

get_checksum_by_fn (fn)

get_checksum_by_target (target)

get_checksums ()

get_description (locale)

get_install_duration ()

get_kind ()

get_location_default ()

get_locations ()

get_size (kind)

get_state ()

get_timestamp ()

get_urgency ()

get_url (url_kind)

get_version ()

set_blob (filename, blob)

set_description (locale, description)

set_install_duration (install_duration)

set_kind (kind)

set_size (kind, size)

set_state (state)

set_timestamp (timestamp)

set_urgency (urgency)

set_url (url_kind, url)

set_version (version)

vercmp (rel2)

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

GObject.Object

Abstract:

No

Structure:

AppStreamGlib.ReleaseClass

classmethod kind_from_string(kind_str)[source]
Parameters:

kind_str (str) – the string.

Returns:

an AppStreamGlib.ReleaseKind or AppStreamGlib.ReleaseKind.UNKNOWN for unknown

Return type:

AppStreamGlib.ReleaseKind

Converts the text representation to an enumerated value.

New in version 0.7.6.

classmethod kind_to_string(kind)[source]
Parameters:

kind (AppStreamGlib.ReleaseKind) – the AppStreamGlib.ReleaseKind.

Returns:

string version of kind

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.7.6.

classmethod new()[source]
Returns:

a AppStreamGlib.Release

Return type:

AppStreamGlib.Release

Creates a new AppStreamGlib.Release.

New in version 0.1.0.

classmethod state_from_string(state)[source]
Parameters:

state (str) – a string

Returns:

A AppStreamGlib.ReleaseState, e.g. AppStreamGlib.ReleaseState.INSTALLED.

Return type:

AppStreamGlib.ReleaseState

Converts the text representation to an enumerated value.

New in version 0.6.6.

classmethod state_to_string(state)[source]
Parameters:

state (AppStreamGlib.ReleaseState) – the AppStreamGlib.ReleaseState, e.g. AppStreamGlib.ReleaseState.INSTALLED

Returns:

string version of state, or None for unknown

Return type:

str

Converts the enumerated value to an text representation.

New in version 0.6.6.

add_checksum(checksum)[source]
Parameters:

checksum (AppStreamGlib.Checksum) – a AppStreamGlib.Checksum instance.

Adds a release checksum.

New in version 0.4.2.

add_location(location)[source]
Parameters:

location (str) – the location string.

Adds a release location.

New in version 0.3.5.

get_blob(filename)[source]
Parameters:

filename (str) – a filename

Returns:

a GLib.Bytes, or None for not set

Return type:

GLib.Bytes

Gets the release blob, which is typically firmware file data.

New in version 0.5.2.

get_checksum_by_fn(fn)[source]
Parameters:

fn (str) – a file basename

Returns:

an AppStreamGlib.Checksum, or None for not found

Return type:

AppStreamGlib.Checksum

Gets the checksum for a release.

New in version 0.4.2.

get_checksum_by_target(target)[source]
Parameters:

target (AppStreamGlib.ChecksumTarget) – a AppStreamGlib.ChecksumTarget, e.g. AppStreamGlib.ChecksumTarget.CONTAINER

Returns:

an AppStreamGlib.Checksum, or None for not found

Return type:

AppStreamGlib.Checksum

Gets the checksum for a release.

New in version 0.4.2.

get_checksums()[source]
Returns:

list of checksums

Return type:

[AppStreamGlib.Checksum]

Gets the release checksums.

New in version 0.4.2.

get_description(locale)[source]
Parameters:

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

Returns:

markup, or None for not set or invalid

Return type:

str

Gets the release description markup for a given locale.

New in version 0.1.0.

get_install_duration()[source]
Returns:

install duration in seconds, or 0 for unset

Return type:

int

Gets the typical install duration.

New in version 0.7.15.

get_kind()[source]
Returns:

enumerated value, e.g. AppStreamGlib.ReleaseKind.STABLE

Return type:

AppStreamGlib.ReleaseKind

Gets the type of the release.

New in version 0.7.6.

get_location_default()[source]
Returns:

string, or None for not set or invalid

Return type:

str

Gets the default release location, typically a URL.

New in version 0.3.5.

get_locations()[source]
Returns:

list of locations

Return type:

[str]

Gets the release locations, typically URLs.

New in version 0.3.5.

get_size(kind)[source]
Parameters:

kind (AppStreamGlib.SizeKind) – a AppStreamGlib.SizeKind, e.g. AppStreamGlib.SizeKind.DOWNLOAD

Returns:

The size in bytes, or 0 for unknown.

Return type:

int

Gets the release size.

New in version 0.5.2.

get_state()[source]
Returns:

enumberated value, or AppStreamGlib.ReleaseState.UNKNOWN for not set or invalid

Return type:

AppStreamGlib.ReleaseState

Gets the release state.

New in version 0.5.8.

get_timestamp()[source]
Returns:

timestamp, or 0 for unset

Return type:

int

Gets the release timestamp.

New in version 0.1.0.

get_urgency()[source]
Returns:

enumberated value, or AppStreamGlib.UrgencyKind.UNKNOWN for not set or invalid

Return type:

AppStreamGlib.UrgencyKind

Gets the release urgency.

New in version 0.5.1.

get_url(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.7.15.

get_version()[source]
Returns:

string, or None for not set or invalid

Return type:

str

Gets the release version.

New in version 0.1.0.

set_blob(filename, blob)[source]
Parameters:

Sets a release blob, which is typically firmware data or a detached signature.

NOTE: This is not stored in the XML file, and is only available in-memory.

New in version 0.5.2.

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

  • description (str) – the description markup.

Sets the description release markup.

New in version 0.1.0.

set_install_duration(install_duration)[source]
Parameters:

install_duration (int) – the install duration in seconds

Sets the typical duration of the install.

New in version 0.7.15.

set_kind(kind)[source]
Parameters:

kind (AppStreamGlib.ReleaseKind) – the AppStreamGlib.ReleaseKind

Sets the release kind.

New in version 0.7.6.

set_size(kind, size)[source]
Parameters:

Sets the release size.

New in version 0.5.2.

set_state(state)[source]
Parameters:

state (AppStreamGlib.ReleaseState) – the release state, e.g. AppStreamGlib.ReleaseState.INSTALLED

Sets the release state.

New in version 0.5.8.

set_timestamp(timestamp)[source]
Parameters:

timestamp (int) – the timestamp value.

Sets the release timestamp.

New in version 0.1.0.

set_urgency(urgency)[source]
Parameters:

urgency (AppStreamGlib.UrgencyKind) – the release urgency, e.g. AppStreamGlib.UrgencyKind.CRITICAL

Sets the release urgency.

New in version 0.5.1.

set_url(url_kind, url)[source]
Parameters:

Adds some URL data to the application.

New in version 0.7.15.

set_version(version)[source]
Parameters:

version (str) – the version string.

Sets the release version.

New in version 0.1.0.

vercmp(rel2)[source]
Parameters:

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

Returns:

-1 if rel1 > rel2, +1 if rel1 < rel2, 0 otherwise

Return type:

int

Compares two release.

New in version 0.4.2.