AppStreamCompose.Compose¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class AppStreamCompose.Compose(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Return type:
Creates a new
AppStreamCompose.Compose
.
- add_allowed_cid(component_id)¶
- Parameters:
component_id (
str
) – The component-id to whitelist
Adds a component ID to the allowlist. If the list is not empty, only components in the list will be added to the metadata output.
- add_custom_allowed(key_id)¶
- Parameters:
key_id (
str
) – the custom key to add to the allowed list.
Add a key to the allowlist that is used to filter custom tag values.
- add_flags(flags)¶
- Parameters:
flags (
AppStreamCompose.ComposeFlags
) – The compose flags to add.
Add compose flags.
- add_unit(unit)¶
- Parameters:
unit (
AppStreamCompose.Unit
) – TheAppStreamCompose.Unit
to add
Add an
AppStreamCompose.Unit
as data source for metadata processing.
- fetch_components()¶
- Returns:
The components
- Return type:
Get the results components extracted in the last data processing run.
- finalize_result(result)¶
- Parameters:
result (
AppStreamCompose.Result
) – theAppStreamCompose.Result
to finalize
Perform final validation of generated data for the specified result container.
- finalize_results()¶
Perform final validation of generated data. Calling this function is not necessary, unless the final check was explicitly disabled using the
AppStreamCompose.ComposeFlags.NO_FINAL_CHECK
flag.
- get_flags()¶
- Return type:
Get the flags controlling compose behavior.
- get_format()¶
- Return type:
get the format type we are generating.
- get_icon_policy()¶
- Returns:
- Return type:
Get the policy for how icons should be distributed to any AppStream clients.
- get_locale_unit()¶
- Returns:
The unit used for locale processing, or
None
for default.- Return type:
Get the unit we use for locale processing
- get_max_screenshot_size()¶
- Return type:
Get the maximum size a screenshot video or image can have. A size < 0 may be returned for no limit, setting a limit of 0 will disable screenshots.
- get_media_baseurl()¶
- Return type:
Get the media base URL to be used for the generated data, or
None
if no media is cached.
- get_media_result_dir()¶
- Return type:
Get the media result directory, that can be served on a webserver.
- get_results()¶
- Returns:
The results
- Return type:
Get the results of the last processing run.
- has_errors()¶
-
Check if the last run generated any errors (which will cause metadata to be ignored).
- remove_custom_allowed(key_id)¶
- Parameters:
key_id (
str
) – the custom key to drop from the allowed list.
Remove a key from the allowlist used to filter the
<custom/>
tag entries.
- remove_flags(flags)¶
- Parameters:
flags (
AppStreamCompose.ComposeFlags
) – The compose flags to remove.
Remove compose flags.
- reset()¶
Reset the results, units and run-specific settings so the instance can be reused for another metadata generation run.
- run(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
.- Raises:
- Returns:
The results, or
None
on error- Return type:
Process the registered units and generate catalog metadata from found components.
- set_cainfo(cainfo)¶
- Parameters:
cainfo (
str
) – a valid file path
Set a CA file holding one or more certificates to verify peers with for download operations performed by this
AppStreamCompose.Compose
.
- set_check_metadata_early_func(func, *user_data)¶
- Parameters:
func (
AppStreamCompose.CheckMetadataEarlyFn
) – the #AscCheckMetainfoLoadResultFn function to be called
Set an custom callback to be run when most of the metadata has been loaded, but no expensive operations (like downloads or icon rendering) have been done yet. This can be used to ignore unwanted components early on.
The callback function may be called from any thread, so it needs to ensure thread safety on its own.
- set_data_result_dir(dir)¶
- Parameters:
dir (
str
) – the metadata save location.
Set an output location where generated metadata should be saved. If this is set to
None
, no metadata will be saved.
- set_flags(flags)¶
- Parameters:
flags (
AppStreamCompose.ComposeFlags
) – The compose flags bitfield.
Set compose flags bitfield that controls the enabled features for this
AppStreamCompose.Compose
.
- set_format(kind)¶
- Parameters:
kind (
AppStream.FormatKind
) – The format, e.g.AppStream.FormatKind.XML
Set the format kind of the catalog metadata that we should generate.
- set_hints_result_dir(dir)¶
- Parameters:
dir (
str
) – the hints data directory.
Set an output location for HTML reports of issues generated during a compose run.
- set_icon_policy(policy)¶
- Parameters:
policy (
AppStreamCompose.IconPolicy
) – anAppStreamCompose.IconPolicy
instance
Set an icon policy object, overriding the existing one.
- set_icons_result_dir(dir)¶
- Parameters:
dir (
str
) – the icon storage location.
Set an output location where plain icons for the processed metadata are stored.
- set_locale_unit(locale_unit)¶
- Parameters:
locale_unit (
AppStreamCompose.Unit
) – the unit used for locale processing.
Set a specific unit that is used for fetching locale information. This may be useful in case a special language pack layout is used, but is generally not necessary to be set explicitly, as locale will be found in the unit where the metadata is by default.
- set_max_screenshot_size(size_bytes)¶
- Parameters:
size_bytes (
int
) – maximum size of a screenshot image or video in bytes
Set the maximum size a screenshot video or image can have. A size < 0 may be set to allow unlimited sizes, setting a limit of 0 will disable screenshot caching entirely.
- set_media_baseurl(url)¶
-
Set the media base URL for the generated metadata. Can be
None
if no media should be cached and the original URLs should be kept.
- set_media_result_dir(dir)¶
- Parameters:
dir (
str
) – the media storage location.
Set an output location to store media (screenshots, icons, …) that will be served on a webserver via the URL set as media baseurl.