Functions

compression_type (name)

error_quark ()

get_version ()

load_file (yaml_file)

load_string (yaml_string)

read_packager_file (yaml_path, module_name, module_stream)

read_packager_string (yaml_string, module_name, module_stream)

yaml_error_quark ()

Details

Modulemd.compression_type(name)
Parameters:

name (str) – The name of the compression type. Valid options are: “gz”, “gzip”, “bz2”, “bzip2”, “xz” and “zck”.

Returns:

The Modulemd.CompressionTypeEnum value corresponding to the provided string if available or Modulemd.CompressionTypeEnum.UNKNOWN_COMPRESSION if the string does not match a known type.

Return type:

Modulemd.CompressionTypeEnum

New in version 2.8.

Modulemd.error_quark()
Returns:

A #GQuark used to identify an error in the general modulemd domain.

Return type:

int

New in version 2.9.

Modulemd.get_version()
Returns:

A string describing the version of libmodulemd.

Return type:

str

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:

GLib.Error

Returns:

A newly-allocated Modulemd.ModuleIndex object initialized with the content from yaml_file. Returns None and sets error if the file is not completely valid.

Return type:

Modulemd.ModuleIndex

This is a convenience function that is a wrapper around Modulemd.ModuleIndex.new() and Modulemd.ModuleIndex.update_from_file() with strict=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 None and 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:

GLib.Error

Returns:

A newly-allocated Modulemd.ModuleIndex object initialized with the content from yaml_string. Returns None and sets error if the metadata is not completely valid.

Return type:

Modulemd.ModuleIndex

This is a convenience function that is a wrapper around Modulemd.ModuleIndex.new() and Modulemd.ModuleIndex.update_from_string() with strict=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 None and 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 (str or None) – 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 (str or None) – 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:

GLib.Error

Returns:

MODULEMD_TYPE_MODULE_STREAM_V2, MODULEMD_TYPE_PACKAGER_V3, or GObject.TYPE_INVALID. Returns the matching GObject.Object through the object parameter. If the return value is GObject.TYPE_INVALID, returns the reason as error.

object:

(transfer full): A newly allocated Modulemd.ModuleStreamV2 or Modulemd.PackagerV3 object 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 (str or None) – 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 (str or None) – 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:

GLib.Error

Returns:

MODULEMD_TYPE_MODULE_STREAM_V2, MODULEMD_TYPE_PACKAGER_V3, or GObject.TYPE_INVALID. Returns the matching GObject.Object through the object parameter. If the return value is GObject.TYPE_INVALID, returns the reason as error.

object:

(transfer full): A newly allocated Modulemd.ModuleStreamV2 or Modulemd.PackagerV3 object initialized with the content from yaml_string.

Return type:

(GObject.GType, object: GObject.Object)

New in version 2.11.

Modulemd.yaml_error_quark()
Returns:

A #GQuark used to identify an error in the modulemd yaml domain.

Return type:

int

New in version 2.9.