AppStreamGlib.Format

g AppStreamGlib.Format AppStreamGlib.Format GObject.Object GObject.Object GObject.Object->AppStreamGlib.Format

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

guess_kind (filename)

class

kind_from_string (kind)

class

kind_to_string (kind)

class

new ()

equal (format2)

get_filename ()

get_kind ()

set_filename (filename)

set_kind (kind)

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

GObject.Object

Abstract:

No

Structure:

AppStreamGlib.FormatClass

classmethod guess_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.6.9.

classmethod kind_from_string(kind)[source]
Parameters:

kind (str) – the string.

Returns:

a AppStreamGlib.FormatKind, or AppStreamGlib.FormatKind.UNKNOWN for unknown.

Return type:

AppStreamGlib.FormatKind

Converts the text representation to an enumerated value.

New in version 0.6.9.

classmethod kind_to_string(kind)[source]
Parameters:

kind (AppStreamGlib.FormatKind) –

Return type:

str

classmethod new()[source]
Returns:

a AppStreamGlib.Format

Return type:

AppStreamGlib.Format

Creates a new AppStreamGlib.Format.

New in version 0.6.9.

equal(format2)[source]
Parameters:

format2 (AppStreamGlib.Format) – a AppStreamGlib.Format instance.

Returns:

True for success

Return type:

bool

Checks if two formats are the same.

New in version 0.6.9.

get_filename()[source]
Returns:

Runtime identifier, e.g. “org.gnome.Platform/i386/master”

Return type:

str

Gets the filename required for this format.

New in version 0.6.9.

get_kind()[source]
Returns:

the AppStreamGlib.FormatKind

Return type:

AppStreamGlib.FormatKind

Gets the format kind.

New in version 0.6.9.

set_filename(filename)[source]
Parameters:

filename (str) – the URL.

Sets the filename required for this format.

New in version 0.6.9.

set_kind(kind)[source]
Parameters:

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

Sets the format kind.

New in version 0.6.9.