Functions

build_component_global_id (component_id, checksum)

canvas_error_quark ()

compose_error_quark ()

filename_from_url (url)

globals_add_hint_tag (tag, severity, explanation, overrideExisting)

globals_clear ()

globals_get_ffprobe_binary ()

globals_get_hint_tags ()

globals_get_optipng_binary ()

globals_get_tmp_dir ()

globals_get_tmp_dir_create ()

globals_get_use_optipng ()

globals_hint_tag_explanation (tag)

globals_hint_tag_severity (tag)

globals_set_ffprobe_binary (path)

globals_set_optipng_binary (path)

globals_set_tmp_dir (path)

globals_set_use_optipng (enabled)

icon_state_from_string (state_str)

icon_state_to_string (istate)

image_error_quark ()

image_format_from_filename (fname)

image_format_from_string (str)

image_format_to_string (format)

optimize_png (fname)

pixbuf_blur (src, radius, iterations)

pixbuf_sharpen (src, radius, amount)

Details

AppStreamCompose.build_component_global_id(component_id, checksum)
Parameters:
  • component_id (str) – an AppStream component ID.

  • checksum (str) – a MD5 hashsum as string generated from the component’s combined metadata.

Return type:

str

Builds a global component ID from a component-id and a (usually MD5) checksum generated from the component data.

The global-id is used as a global, unique identifier for a component. (while the component-ID is local, e.g. for one source). Its primary usecase is to identify a media directory on the filesystem which is associated with this component.

AppStreamCompose.canvas_error_quark()
Returns:

An error quark.

Return type:

int

AppStreamCompose.compose_error_quark()
Returns:

An error quark.

Return type:

int

AppStreamCompose.filename_from_url(url)
Parameters:

url (str) – The URL to extract a filename from.

Return type:

str

Generate a filename from a web-URL that can be used to store the file on disk after download.

AppStreamCompose.globals_add_hint_tag(tag, severity, explanation, overrideExisting)
Parameters:
Returns:

True if the tag was registered and did not exist previously.

Return type:

bool

Register a new hint tag. If a previous tag with the given name already existed, the existing tag will not be replaced unless overrideExisting is set to True. Please be careful when overriding tags! Tag severities can not be lowered by overriding a tag.

AppStreamCompose.globals_clear()

Clear all global state and restore defaults.

AppStreamCompose.globals_get_ffprobe_binary()
Return type:

str

Get path to the “ffprobe” binary we should use.

AppStreamCompose.globals_get_hint_tags()
Returns:

A list of valid hint tags. Free with GLib.strfreev

Return type:

[str]

Retrieve all hint tags that we know.

AppStreamCompose.globals_get_optipng_binary()
Return type:

str

Get path to the “optipng” binary we should use.

AppStreamCompose.globals_get_tmp_dir()
Return type:

str

Get temporary directory used by appstream-compose.

AppStreamCompose.globals_get_tmp_dir_create()
Return type:

str

Get temporary directory used by appstream-compose and try to create it if it does not exist.

AppStreamCompose.globals_get_use_optipng()
Return type:

bool

Get whether images should be optimized using optipng.

AppStreamCompose.globals_hint_tag_explanation(tag)
Parameters:

tag (str) –

Returns:

An explanation template, or None if the tag was not found.

Return type:

str

Retrieve the explanation template of the given hint tag.

AppStreamCompose.globals_hint_tag_severity(tag)
Parameters:

tag (str) –

Returns:

An AppStream.IssueSeverity or AppStream.IssueSeverity.UNKNOWN if the tag did not exist or has an unknown severity.

Return type:

AppStream.IssueSeverity

Retrieve the severity of the given hint tag.

AppStreamCompose.globals_set_ffprobe_binary(path)
Parameters:

path (str) –

Set path to the “ffprobe” binary we should use.

AppStreamCompose.globals_set_optipng_binary(path)
Parameters:

path (str) –

Set path to the “optipng” binary we should use.

AppStreamCompose.globals_set_tmp_dir(path)
Parameters:

path (str) –

Set temporary directory used by appstream-compose.

AppStreamCompose.globals_set_use_optipng(enabled)
Parameters:

enabled (bool) –

Set whether images should be optimized using optipng.

AppStreamCompose.icon_state_from_string(state_str)
Parameters:

state_str (str) – the string.

Returns:

a AppStreamCompose.IconState

Return type:

AppStreamCompose.IconState

Converts the text representation to an enumerated value.

AppStreamCompose.icon_state_to_string(istate)
Parameters:

istate (AppStreamCompose.IconState) – the AppStreamCompose.IconState.

Returns:

string version of istate

Return type:

str

Converts the enumerated value to an text representation.

AppStreamCompose.image_error_quark()
Returns:

An error quark.

Return type:

int

AppStreamCompose.image_format_from_filename(fname)
Parameters:

fname (str) – the filename.

Returns:

a AppStreamCompose.ImageFormat or AppStreamCompose.ImageFormat.UNKNOWN for unknown

Return type:

AppStreamCompose.ImageFormat

Returns the image format type based on the given file’s filename.

AppStreamCompose.image_format_from_string(str)
Parameters:

str (str) – the string.

Returns:

a AppStreamCompose.ImageFormat or AppStreamCompose.ImageFormat.UNKNOWN for unknown

Return type:

AppStreamCompose.ImageFormat

Converts the text representation to an enumerated value.

AppStreamCompose.image_format_to_string(format)
Parameters:

format (AppStreamCompose.ImageFormat) – the AppStreamCompose.ImageFormat.

Returns:

string version of format

Return type:

str

Converts the enumerated value to an text representation.

AppStreamCompose.optimize_png(fname)
Parameters:

fname (str) – Filename of the PNG image to optimize.

Raises:

GLib.Error

Return type:

bool

Optimizes a PNG graphic for size with optipng, if its binary is available and this feature is enabled.

AppStreamCompose.pixbuf_blur(src, radius, iterations)
Parameters:
AppStreamCompose.pixbuf_sharpen(src, radius, amount)
Parameters: