Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Modulemd.compression_type(name)¶
- Parameters:
name (
str) – The name of the compression type. Valid options are: “gz”, “gzip”, “bz2”, “bzip2”, “xz”, “zck”, and “zstd”.- Returns:
The
Modulemd.CompressionTypeEnumvalue corresponding to the provided string if available orModulemd.CompressionTypeEnum.UNKNOWN_COMPRESSIONif the string does not match a known type.- Return type:
New in version 2.8.
- Modulemd.error_quark()¶
- Returns:
A #GQuark used to identify an error in the general modulemd domain.
- Return type:
New in version 2.9.
- Modulemd.get_version()¶
- Returns:
A string describing the version of libmodulemd.
- Return type:
New in version 2.0.
- Modulemd.load_file(yaml_file)¶
- Parameters:
yaml_file (
str) – A YAML file containing the module metadata and other related information such as default streams.- Raises:
- Returns:
A newly-allocated
Modulemd.ModuleIndexobject initialized with the content from yaml_file. ReturnsNoneand sets error if the file is not completely valid.- Return type:
This is a convenience function that is a wrapper around
Modulemd.ModuleIndex.new() andModulemd.ModuleIndex.update_from_file() withstrict=False.It will return the imported module metadata if all subdocuments are parseable and valid. If any part of the document is unreadable or fails validation, it will return
Noneand set error appropriately. If you need more detail about which parts of the document failed, use the lower-level functions.New in version 2.10.
- Modulemd.load_string(yaml_string)¶
- Parameters:
yaml_string (
str) – A YAML string containing the module metadata and other related information such as default streams.- Raises:
- Returns:
A newly-allocated
Modulemd.ModuleIndexobject initialized with the content from yaml_string. ReturnsNoneand sets error if the metadata is not completely valid.- Return type:
This is a convenience function that is a wrapper around
Modulemd.ModuleIndex.new() andModulemd.ModuleIndex.update_from_string() withstrict=False.It will return the imported module metadata if all subdocuments are parseable and valid. If any part of the document is unreadable or fails validation, it will return
Noneand set error appropriately. If you need more detail about which parts of the document failed, use the lower-level functions.New in version 2.10.
- Modulemd.read_packager_file(yaml_path, module_name, module_stream)¶
- Parameters:
yaml_path (
str) – A path to a YAML file containing a packager document.module_name (
strorNone) – An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.module_stream (
strorNone) – An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.
- Raises:
- Returns:
MODULEMD_TYPE_MODULE_STREAM_V2, MODULEMD_TYPE_PACKAGER_V3, or
GObject.TYPE_INVALID. Returns the matchingGObject.Objectthrough the object parameter. If the return value isGObject.TYPE_INVALID, returns the reason as error.- object:
(transfer full): A newly allocated
Modulemd.ModuleStreamV2orModulemd.PackagerV3object initialized with the content from yaml_path.
- Return type:
(
GObject.GType, object:GObject.Object)
New in version 2.11.
- Modulemd.read_packager_string(yaml_string, module_name, module_stream)¶
- Parameters:
yaml_string (
str) – A YAML string containing a packager document.module_name (
strorNone) – An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.module_stream (
strorNone) – An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.
- Raises:
- Returns:
MODULEMD_TYPE_MODULE_STREAM_V2, MODULEMD_TYPE_PACKAGER_V3, or
GObject.TYPE_INVALID. Returns the matchingGObject.Objectthrough the object parameter. If the return value isGObject.TYPE_INVALID, returns the reason as error.- object:
(transfer full): A newly allocated
Modulemd.ModuleStreamV2orModulemd.PackagerV3object initialized with the content from yaml_string.
- Return type:
(
GObject.GType, object:GObject.Object)
New in version 2.11.