Modulemd.Module

g GObject.Object GObject.Object Modulemd.Module Modulemd.Module GObject.Object->Modulemd.Module

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

clear_xmds ()

copy ()

get_all_streams ()

get_defaults ()

get_module_name ()

get_newest_active_obsoletes (stream, context)

get_obsoletes ()

get_stream_by_NSVC (stream_name, version, context)

get_stream_by_NSVCA (stream_name, version, context, arch)

get_stream_names ()

get_streams_by_stream_name (stream_name)

get_translation (stream)

remove_streams_by_NSVCA (stream_name, version, context, arch)

search_streams (stream_name, version, context, arch)

search_streams_by_glob (stream_name, version, context, arch)

search_streams_by_nsvca_glob (nsvca_pattern)

validate ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

module-name

str

r/w/co

The name of this module.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Modulemd.Module(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Modulemd.ModuleClass

clear_xmds()

Iterates through all Modulemd.ModuleStream entries in this Modulemd.Module and removes any XMD sections that are present. This is generally done to trim down the metadata to only the portions that are useful to the package manager.

New in version 2.14.

copy()
Returns:

A deep copy of this Modulemd.Module object.

Return type:

Modulemd.Module

New in version 2.0.

get_all_streams()
Returns:

A list of all available stream objects associated with this module. There may be multiple streams with the same name and different version and context. The order of items in this list is not guaranteed.

Return type:

[Modulemd.ModuleStream]

New in version 2.0.

get_defaults()
Returns:

The defaults of this module or None if none.

Return type:

Modulemd.Defaults

New in version 2.0.

get_module_name()
Returns:

The module name.

Return type:

str

New in version 2.0.

get_newest_active_obsoletes(stream, context)
Parameters:
  • stream (str) – The stream to look up obsoletes for.

  • context (str or None) – The stream context to look up obsoletes for.

Returns:

The newest active obsoletes attached to this module with specified stream and context (when eol_date is not set or it already occurred the obsoletes is active). If no context is passed it matches obsoletes without context.

Return type:

Modulemd.Obsoletes

New in version 2.10.

get_obsoletes()
Returns:

A list of all obsoletes attached to this module. These are pointers to the internal memory objects and must not be modified or freed.

Return type:

[Modulemd.Obsoletes]

New in version 2.10.

get_stream_by_NSVC(stream_name, version, context)
Parameters:
  • stream_name (str) – The name of the stream to retrieve.

  • version (int) – The version of the stream to retrieve.

  • context (str) – The context of the stream to retrieve.

Returns:

The requested stream object or None if no match was found.

Return type:

Modulemd.ModuleStream

New in version 2.0.

Deprecated since version 2.2: Use Modulemd.Module.get_stream_by_NSVCA() instead.

get_stream_by_NSVCA(stream_name, version, context, arch)
Parameters:
  • stream_name (str) – The name of the stream to retrieve.

  • version (int) – The version of the stream to retrieve. If set to zero, the version is not included in the search.

  • context (str or None) – The context of the stream to retrieve. If None, the context is not included in the search.

  • arch (str or None) – The processor architecture of the stream to retrieve. If None, the architecture is not included in the search.

Raises:

GLib.Error

Returns:

The requested stream object. None and sets error appropriately if the provided information is not sufficient to return exactly one Modulemd.ModuleStream result.

Return type:

Modulemd.ModuleStream

New in version 2.2.

get_stream_names()
Returns:

An ordered #GStrv list of stream names in this module.

Return type:

[str]

New in version 2.6.

get_streams_by_stream_name(stream_name)
Parameters:

stream_name (str) – The name of the stream to retrieve.

Returns:

A list of all available stream objects associated with a particular stream name, sorted highest to lowest by the version. The same version may have more than one associated context.

Return type:

[Modulemd.ModuleStream]

New in version 2.0.

get_translation(stream)
Parameters:

stream (str) – The stream to look up translations for.

Returns:

The set of translations attached to streams.

Return type:

Modulemd.Translation

New in version 2.8.

remove_streams_by_NSVCA(stream_name, version, context, arch)
Parameters:
  • stream_name (str) – The name of the stream to remove.

  • version (int) – The version of the stream to remove. If set to zero, matches all versions.

  • context (str or None) – The context of the stream to remove. If None, matches all stream contexts.

  • arch (str or None) – The processor architecture of the stream to remove. If None, matches all architectures.

Remove one or more Modulemd.ModuleStream objects from this Modulemd.Module that match the provided parameters.

New in version 2.3.

search_streams(stream_name, version, context, arch)
Parameters:
  • stream_name (str) – The name of the stream to retrieve.

  • version (int) – The version of the stream to retrieve. If set to zero, the version is not included in the search.

  • context (str or None) – The context of the stream to retrieve. If None, the context is not included in the search.

  • arch (str or None) – The processor architecture of the stream to retrieve. If None, the architecture is not included in the search.

Returns:

The list of stream objects matching the requested parameters. This function cannot fail, but it may return a zero-length list if no matches were found. The returned streams will be in a predictable order, sorted first by stream name, then by version (highest to lowest), then by context and finally by architecture.

Return type:

[Modulemd.ModuleStream]

New in version 2.5.

search_streams_by_glob(stream_name, version, context, arch)
Parameters:
  • stream_name (str or None) – The name of the stream to retrieve. If None, will search all streams.

  • version (str or None) – The version of the stream to retrieve. If None, will search all versions.

  • context (str or None) – The context of the stream to retrieve. If None, will search all contexts.

  • arch (str or None) – The processor architecture of the stream to retrieve. If None, the architecture is not included in the search.

Returns:

The list of stream objects matching all of the requested parameters. This function cannot fail, but it may return a zero-length list if no matches were found. The returned streams will be in a predictable order, sorted first by module name, then stream name, then by version (highest first), then by context and finally by architecture.

Return type:

[Modulemd.ModuleStream]

All arguments to this method will be compared using fnmatch(3).

New in version 2.9.

search_streams_by_nsvca_glob(nsvca_pattern)
Parameters:

nsvca_pattern (str or None) – A glob pattern to match against the NSVCA strings of the Modulemd.ModuleStream objects in this module. If None, this will match all NSVCAs.

Returns:

An array of Modulemd.ModuleStream objects whose NSVCA string matches the provided pattern. This function cannot fail, but may return an array of zero entries if the pattern did not match any streams. The returned streams will be in a predictable order, sorted first by module name, then stream name, then by version (highest first), then by context and finally by architecture.

Return type:

[Modulemd.ModuleStream]

New in version 2.9.

validate()
Raises:

GLib.Error

Returns:

True if validation passed, False and sets error if failed.

Return type:

bool

New in version 2.0.

Property Details

Modulemd.Module.props.module_name
Name:

module-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of this module.