libpkgmanifest.input
- class libpkgmanifest.input.Input(*args)
Stores all information related to the items defined in the input file.
Notes: The file serves as input data for clients generating the manifest.
- get_archs()
Retrieves a list of architectures from the input file.
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
A list of architectures.
- get_document()
Retrieves the YAML document identifier.
Notes: This is expected to be the value “rpm-package-input”.
- Return type:
string
- Returns:
The document identifier.
- get_modules()
Retrieves a structure containing all the modules and their associated actions from the input file.
- Return type:
- Returns:
A structure with the modules listed in the input.
- get_options()
Retrieves a structure containing options to override the default package manager behavior.
- Return type:
- Returns:
A structure with the options listed in the input.
- get_packages()
Retrieves a structure containing all packages and their associated actions from the input file.
- Return type:
- Returns:
A structure with the packages listed in the input.
- get_repositories()
Retrieves a structure containing all repositories defined in the input file.
- Return type:
- Returns:
A structure with the repositories listed in the input.
- get_version()
Retrieves the version of the YAML document.
Notes: This version changes if the structure or format of the document’s properties has been updated.
- Return type:
- Returns:
The document version.
- set_document(document)
Sets the YAML document identifier.
- Parameters:
document (string) – The YAML identifier to set.
- set_modules(modules)
Sets the modules to be included in the input file.
- Parameters:
modules (
Modules) – A structure containing the modules to set.
- set_options(options)
Sets the options to be included in the input file.
- Parameters:
options (
Options) – A structure containing the options to set.
- set_packages(packages)
Sets the packages to be included in the input file.
- Parameters:
packages (
Packages) – A structure containing the packages to set.
- set_repositories(repositories)
Sets the repositories to be included in the input file.
- Parameters:
repositories (
Repositories) – A structure containing the repositories to set.
- set_version(version)
Sets the version of the YAML document.
- Parameters:
version (
Version) – The version to set for the document.
- thisown
- class libpkgmanifest.input.MapRepositories(*args)
- asdict()
- begin()
- clear()
- count(x)
- empty()
- end()
- erase(*args)
- find(x)
- get_allocator()
- has_key(key)
- items()
- iterator()
- iteritems()
- iterkeys()
- itervalues()
- key_iterator()
- keys()
- lower_bound(x)
- rbegin()
- rend()
- size()
- swap(v)
- thisown
- upper_bound(x)
- value_iterator()
- values()
- class libpkgmanifest.input.Modules(*args)
A container with modular packages and their associated actions.
- get_disables()
Retrieves a list of modules to be disabled for resolving manifest content.
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
A vector containing modules to be disabled.
- get_enables()
Retrieves a list of modules to be enabled for resolving manifest content.
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
A vector containing modules to be enabled.
- thisown
- class libpkgmanifest.input.NoSuchRepositoryIdError(message)
Exception thrown when a repository with a given ID does not exist.
- thisown
- class libpkgmanifest.input.Options(*args)
A class containing options to override the default package manager behavior when resolving manifest content.
- get_allow_erasing()
Checks if the package manager is allowed to remove installed packages to resolve dependency issues.
- Return type:
boolean
- Returns:
True if the package manager is allowed to remove packages, otherwise false.
- set_allow_erasing(value)
Sets whether the package manager is allowed to remove installed packages to resolve dependency issues.
- Parameters:
value (boolean) – True to allow the package manager to remove packages, otherwise false.
- thisown
- class libpkgmanifest.input.Packages(*args)
A container with input packages and their associated actions.
- get_installs()
Retrieves a list of packages designated for installation when resolving manifest content.
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
A vector containing installation packages.
- get_reinstalls()
Retrieves a list of packages designated for reinstallation when resolving manifest content.
- Return type:
std::vector< std::string,std::allocator< std::string > >
- Returns:
A vector containing reinstallation packages.
- thisown
- class libpkgmanifest.input.Parser
A class responsible for parsing the YAML files into objects.
- parse(path)
Parses the input file from a specified file path.
- Parameters:
path (string) – The location of the input file.
- Return type:
- Returns:
An input object containing data parsed from the file.
- Raises:
ParserError if an error occurs during file parsing.
- parse_prototype(path)
Parses the input file in prototype format from a specified file path.
Notes: This ensures compatibility with clients that have already deployed the existing prototype format.
- Parameters:
path (string) – The location of the input file.
- Return type:
- Returns:
An input object containing data parsed from the file.
- Raises:
ParserError if an error occurs during file parsing.
- thisown
- class libpkgmanifest.input.Repositories(*args)
A container for all repositories listed in the manifest.
- add(repository)
Adds a repository to the container.
- Parameters:
repository (
Repository) – The repository to add.
- begin()
Returns an iterator to the beginning of the container.
- contains(id)
Checks if a given repository exists.
- Parameters:
id (string) – The repository ID.
- Return type:
boolean
- Returns:
True if the given repository exists; otherwise, false.
- end()
Returns an iterator to the end of the container.
- get(id)
Retrieves a repository by its ID.
- Parameters:
id (string) – The repository ID.
- Return type:
- Returns:
A repository with the given ID.
- size()
Gets the number of repositories in the container.
- Return type:
std::size_t
- Returns:
The size of the repositories container.
- thisown
- libpkgmanifest.input.Repositories__iter__(self)
- class libpkgmanifest.input.Repository(*args)
Represents a single repository within the manifest.
- get_baseurl()
Retrieves the base URL of the repository.
- Return type:
string
- Returns:
The base URL.
- get_id()
Retrieves the repository ID.
- Return type:
string
- Returns:
The repository ID.
- get_metalink()
Retrieves the metalink URL of the repository.
- Return type:
string
- Returns:
The metalink URL.
- get_mirrorlist()
Retrieves the mirrorlist URL of the repository.
- Return type:
string
- Returns:
The mirrorlist URL.
- set_baseurl(baseurl)
Sets the base URL of the repository.
- Parameters:
baseurl (string) – The base URL to set.
- set_id(id)
Sets the repository ID.
- Parameters:
id (string) – The repository ID to set.
- set_metalink(metalink)
Sets the metalink URL of the repository.
- Parameters:
metalink (string) – The metalink URL to set.
- set_mirrorlist(mirrorlist)
Sets the mirrorlist URL of the repository.
- Parameters:
mirrorlist (string) – The mirrorlist URL to set.
- thisown
- class libpkgmanifest.input.SwigPyIterator(*args, **kwargs)
- advance(n)
- copy()
- decr(n=1)
- distance(x)
- equal(x)
- incr(n=1)
- next()
- previous()
- thisown
- value()
- class libpkgmanifest.input.VectorString(*args)
- append(x)
- assign(n, x)
- back()
- begin()
- capacity()
- clear()
- empty()
- end()
- erase(*args)
- front()
- get_allocator()
- insert(*args)
- iterator()
- pop()
- pop_back()
- push_back(x)
- rbegin()
- rend()
- reserve(n)
- resize(*args)
- size()
- swap(v)
- thisown
- libpkgmanifest.input.VectorString__add__(self, value)
- libpkgmanifest.input.VectorString__append(self, item)
- libpkgmanifest.input.VectorString__copy(self)
- libpkgmanifest.input.VectorString__count(self, item)
- libpkgmanifest.input.VectorString__eq__(self, other)
- libpkgmanifest.input.VectorString__extend(self, iterable)
- libpkgmanifest.input.VectorString__ge__(self, other)
- libpkgmanifest.input.VectorString__gt__(self, other)
- libpkgmanifest.input.VectorString__iadd__(self, value)
- libpkgmanifest.input.VectorString__imul__(self, value)
- libpkgmanifest.input.VectorString__index(self, *args, **kwargs)
- libpkgmanifest.input.VectorString__insert(self, *args, **kwargs)
- libpkgmanifest.input.VectorString__le__(self, other)
- libpkgmanifest.input.VectorString__lt__(self, other)
- libpkgmanifest.input.VectorString__mul__(self, value)
- libpkgmanifest.input.VectorString__ne__(self, other)
- libpkgmanifest.input.VectorString__remove(self, *args, **kwargs)
- libpkgmanifest.input.VectorString__reverse(self, *args, **kwargs)
- libpkgmanifest.input.VectorString__rmul__(self, value)
- libpkgmanifest.input.VectorString__sort(self, *args, **kwargs)
- libpkgmanifest.input.VectorString__str__(self)
- class libpkgmanifest.input.Version(*args)
Structure representing a version, supporting up to three components.
- get_major()
Retrieves the major version component.
- Return type:
int
- Returns:
The major version number.
- get_minor()
Retrieves the minor version component.
- Return type:
int
- Returns:
The minor version number.
- get_patch()
Retrieves the patch version component.
- Return type:
int
- Returns:
The patch version number.
- set_major(major)
Sets the major version component.
- Parameters:
major (int) – The value of the major version component.
- set_minor(minor)
Sets the minor version component.
- Parameters:
minor (int) – The value for the minor version component.
- set_patch(patch)
Sets the patch version component.
- Parameters:
patch (int) – The value for the patch version component.
- thisown
- libpkgmanifest.input.add_property_accessors(target_cls, src_cls=None, src_getter=None)
Dynamically creates attributes in the target class based on the getter and setter methods of a source class.
This method inspects the source class for methods with ‘get_’ and ‘set_’ prefixes, and creates corresponding properties in the target class. If a src_getter is provided, it is used to obtain an instance of the source class, allowing for delegation of property access.
- Args:
target_cls (type): The class where the properties will be added. src_cls (type, optional): The class to inspect for getter and setter methods.
If not provided, the target class is used.
- src_getter (callable, optional): A callable that takes an instance of the target class
and returns an instance of the source class. This is used for delegating property access.
- Example:
1. Simplifying Access in the Package Class - Before: package.get_size() - After calling add_property_accessors(Package): package.size
2. Delegating Access of Internal Objects - Before: package.get_nevra().get_name() - After calling add_property_accessors(Package, Nevra, Package.get_nevra): package.name