Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- AppStreamCompose.build_component_global_id(component_id, checksum)¶
- Parameters:
- Return type:
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.filename_from_url(url)¶
-
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:
tag (
str) – the tag-ID to addseverity (
AppStream.IssueSeverity) – the tag severity asAppStream.IssueSeverityexplanation (
str) – the tag explanatory messageoverrideExisting (
bool) – whether an existing tag should be replaced
- Returns:
Trueif the tag was registered and did not exist previously.- Return type:
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:
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:
Get path to the “optipng” binary we should use.
- AppStreamCompose.globals_get_tmp_dir()¶
- Return type:
Get temporary directory used by appstream-compose.
- AppStreamCompose.globals_get_tmp_dir_create()¶
- Return type:
Get temporary directory used by appstream-compose and try to create it if it does not exist.
- AppStreamCompose.globals_get_use_optipng()¶
- Return type:
Get whether images should be optimized using optipng.
- AppStreamCompose.globals_hint_tag_explanation(tag)¶
- Parameters:
tag (
str) –- Returns:
An explanation template, or
Noneif the tag was not found.- Return type:
Retrieve the explanation template of the given hint tag.
- AppStreamCompose.globals_hint_tag_severity(tag)¶
- Parameters:
tag (
str) –- Returns:
An
AppStream.IssueSeverityorAppStream.IssueSeverity.UNKNOWNif the tag did not exist or has an unknown severity.- Return type:
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:
- Return type:
Converts the text representation to an enumerated value.
- AppStreamCompose.icon_state_to_string(istate)¶
- Parameters:
istate (
AppStreamCompose.IconState) – theAppStreamCompose.IconState.- Returns:
string version of istate
- Return type:
Converts the enumerated value to an text representation.
- AppStreamCompose.image_format_from_filename(fname)¶
- Parameters:
fname (
str) – the filename.- Returns:
a
AppStreamCompose.ImageFormatorAppStreamCompose.ImageFormat.UNKNOWNfor unknown- Return type:
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.ImageFormatorAppStreamCompose.ImageFormat.UNKNOWNfor unknown- Return type:
Converts the text representation to an enumerated value.
- AppStreamCompose.image_format_to_string(format)¶
- Parameters:
format (
AppStreamCompose.ImageFormat) – theAppStreamCompose.ImageFormat.- Returns:
string version of format
- Return type:
Converts the enumerated value to an text representation.
- AppStreamCompose.optimize_png(fname)¶
- Parameters:
fname (
str) – Filename of the PNG image to optimize.- Raises:
- Return type:
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:
src (
GdkPixbuf.Pixbuf) –radius (
int) –iterations (
int) –
- AppStreamCompose.pixbuf_sharpen(src, radius, amount)¶
- Parameters:
src (
GdkPixbuf.Pixbuf) –radius (
int) –amount (
float) –