libpkgmanifest.common
- class libpkgmanifest.common.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.common.NoSuchRepositoryIdError(message)
Exception thrown when a repository with a given ID does not exist.
- thisown
- class libpkgmanifest.common.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.common.Repositories__iter__(self)
- class libpkgmanifest.common.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.common.SwigPyIterator(*args, **kwargs)
- advance(n)
- copy()
- decr(n=1)
- distance(x)
- equal(x)
- incr(n=1)
- next()
- previous()
- thisown
- value()
- class libpkgmanifest.common.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.common.VectorString__add__(self, value)
- libpkgmanifest.common.VectorString__append(self, item)
- libpkgmanifest.common.VectorString__copy(self)
- libpkgmanifest.common.VectorString__count(self, item)
- libpkgmanifest.common.VectorString__eq__(self, other)
- libpkgmanifest.common.VectorString__extend(self, iterable)
- libpkgmanifest.common.VectorString__ge__(self, other)
- libpkgmanifest.common.VectorString__gt__(self, other)
- libpkgmanifest.common.VectorString__iadd__(self, value)
- libpkgmanifest.common.VectorString__imul__(self, value)
- libpkgmanifest.common.VectorString__index(self, *args, **kwargs)
- libpkgmanifest.common.VectorString__insert(self, *args, **kwargs)
- libpkgmanifest.common.VectorString__le__(self, other)
- libpkgmanifest.common.VectorString__lt__(self, other)
- libpkgmanifest.common.VectorString__mul__(self, value)
- libpkgmanifest.common.VectorString__ne__(self, other)
- libpkgmanifest.common.VectorString__remove(self, *args, **kwargs)
- libpkgmanifest.common.VectorString__reverse(self, *args, **kwargs)
- libpkgmanifest.common.VectorString__rmul__(self, value)
- libpkgmanifest.common.VectorString__sort(self, *args, **kwargs)
- libpkgmanifest.common.VectorString__str__(self)
- class libpkgmanifest.common.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.common.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