AppStreamCompose.Unit¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class AppStreamCompose.Unit(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Return type:
Creates a new
AppStreamCompose.Unit
.
- add_relevant_path(path)¶
- Parameters:
path (
str
) – path to be considered relevant
Add a path to the list of relevant directories. A unit may only read data in paths that were previously registered as relevant.
- close()¶
Close this unit, possibly freeing its resources. Calls to read_data() or get_contents() may not produce results until open() is called again.
- file_exists(filename)¶
-
Returns
True
if the filename exists and is readable usingAppStreamCompose.Unit.read_data
.
- get_bundle_id()¶
- Return type:
Gets the ID name of the bundle (a package / Flatpak / any entity containing metadata) that this unit represents.
- get_bundle_id_safe()¶
- Return type:
Gets the ID name of the bundle, normalized to be safe to use in filenames. This may *not* be the same name as set via
AppStreamCompose.Unit.get_bundle_id
()
- get_bundle_kind()¶
- Return type:
Gets the bundle kind of this unit.
- get_contents()¶
- Returns:
A file listing
- Return type:
[
str
]
Get a list of all files contained by this unit.
- get_relevant_paths()¶
- Returns:
A list of paths
- Return type:
[
str
]
Get a list of paths that are relevant for data processing.
- get_user_data()¶
-
Get user-defined data. This is a helper function for bindings.
- open()¶
- Raises:
- Return type:
Open this unit, populating its content listing.
- read_data(filename)¶
- Parameters:
filename (
str
) – The file to read data for.- Raises:
- Return type:
Read the contents of the selected file into memory and return them.
- set_bundle_id(id)¶
- Parameters:
id (
str
) – The new ID.
Sets the ID of the bundle represented by this unit.
- set_bundle_kind(kind)¶
- Parameters:
kind (
AppStream.BundleKind
) –
Sets the kind of the bundle this unit represents.
- set_contents(contents)¶
- Parameters:
contents ([
str
]) – A list of files contained by this unit.
Set list of files this unit contains.
- set_user_data(user_data)¶
-
Assign user-defined data to this object. This is a helper function for bindings.
- do_close() virtual¶
Close this unit, possibly freeing its resources. Calls to read_data() or get_contents() may not produce results until open() is called again.
- do_file_exists(filename) virtual¶
-
Returns
True
if the filename exists and is readable usingAppStreamCompose.Unit.read_data
.