ahriman.core.formatters package
Submodules
ahriman.core.formatters.aur_printer module
- class AurPrinter(package: AURPackage)
Bases:
StringPrinter
print content of the AUR package
- package
AUR package description
- Type:
default constructor
- Parameters:
package (AURPackage) – AUR package description
ahriman.core.formatters.build_printer module
- class BuildPrinter(package: Package, is_success: bool, use_utf: bool)
Bases:
StringPrinter
print content of the build result
default constructor
- Parameters:
package (Package) – built package
is_success (bool) – True in case if build has success status and False otherwise
use_utf (bool) – use utf instead of normal symbols
- static sign(is_success: bool, use_utf: bool) str
generate sign according to settings
- Parameters:
is_success (bool) – True in case if build has success status and False otherwise
use_utf (bool) – use utf instead of normal symbols
- Returns:
sign symbol according to current settings
- Return type:
str
ahriman.core.formatters.changes_printer module
- class ChangesPrinter(changes: Changes)
Bases:
Printer
print content of the changes object
default constructor
- Parameters:
changes (Changes) – package changes
- properties() list[Property]
convert content into printable data
- Returns:
list of content properties
- Return type:
list[Property]
- title() str | None
generate entry title from content
- Returns:
content title if it can be generated and None otherwise
- Return type:
str | None
ahriman.core.formatters.configuration_paths_printer module
- class ConfigurationPathsPrinter(root: Path, includes: list[Path])
Bases:
StringPrinter
print configuration paths
- includes
list of include files
- Type:
list[Path]
default constructor
- Parameters:
root (Path) – path to root configuration file
includes (list[Path]) – list of include files
ahriman.core.formatters.configuration_printer module
- class ConfigurationPrinter(section: str, values: dict[str, str])
Bases:
StringPrinter
print content of the configuration section
- HIDE_KEYS
(class attribute) hide values for mentioned keys. This list must be used in order to hide passwords from outputs
- Type:
list[str]
- values
configuration values dictionary
- Type:
dict[str, str]
default constructor
- Parameters:
section (str) – section name
values (dict[str, str]) – configuration values dictionary
ahriman.core.formatters.package_printer module
- class PackagePrinter(package: Package, status: BuildStatus)
Bases:
StringPrinter
print content of the internal package object
- status
build status
- Type:
default constructor
- Parameters:
package (Package) – package description
status (BuildStatus) – build status
ahriman.core.formatters.patch_printer module
- class PatchPrinter(package_base: str, patches: list[PkgbuildPatch])
Bases:
StringPrinter
print content of the PKGBUILD patch
- patches
PKGBUILD patch object
- Type:
list[PkgbuildPatch]
default constructor
- Parameters:
package_base (str) – package base
patches (list[PkgbuildPatch]) – PKGBUILD patch object
ahriman.core.formatters.printer module
- class Printer
Bases:
object
base class for formatters
- print(*, verbose: bool, log_fn: ~collections.abc.Callable[[str], None] = <built-in function print>, separator: str = ': ') None
print content
- Parameters:
verbose (bool) – print all fields
log_fn (Callable[[str], None], optional) – logger function to log data (Default value = print)
separator (str, optional) – separator for property name and property value (Default value = “: “)
- properties() list[Property]
convert content into printable data
- Returns:
list of content properties
- Return type:
list[Property]
- title() str | None
generate entry title from content
- Returns:
content title if it can be generated and None otherwise
- Return type:
str | None
ahriman.core.formatters.repository_printer module
- class RepositoryPrinter(repository_id: RepositoryId)
Bases:
StringPrinter
print repository unique identifier
- repository_id
repository unique identifier
- Type:
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
ahriman.core.formatters.status_printer module
- class StatusPrinter(status: BuildStatus)
Bases:
StringPrinter
print content of the status object
default constructor
- Parameters:
status (BuildStatus) – build status
ahriman.core.formatters.string_printer module
- class StringPrinter(content: str)
Bases:
Printer
print content of the random string
- content
any content string
- Type:
str
default constructor
- Parameters:
content (str) – any content string
- title() str | None
generate entry title from content
- Returns:
content title if it can be generated and None otherwise
- Return type:
str | None
ahriman.core.formatters.tree_printer module
- class TreePrinter(level: int, packages: list[Package])
Bases:
StringPrinter
print content of the package tree level
default constructor
- Parameters:
level (int) – dependencies tree level
packages (list[Package]) – packages which belong to this level
ahriman.core.formatters.update_printer module
- class UpdatePrinter(remote: Package, local_version: str | None)
Bases:
StringPrinter
print content of the package update
- local_version
local version of the package if any
- Type:
str | None
default constructor
- Parameters:
remote (Package) – remote (new) package object
local_version (str | None) – local version of the package if any
ahriman.core.formatters.user_printer module
ahriman.core.formatters.validation_printer module
- class ValidationPrinter(node: str, errors: list[str | dict[str, Any]])
Bases:
StringPrinter
print content of the validation errors
- node
root level name
- Type:
str
- errors
validation errors
- Type:
list[str | dict[str, Any]]
default constructor
- Parameters:
node (str) – root level name
errors (list[str | dict[str, Any]]) – validation errors
- static get_error_messages(node: str, errors: list[str | dict[str, Any]], current_level: int = 1) Generator[Property, None, None]
extract default error message from cerberus class
- Parameters:
node (str) – current node level name
errors (list[str | dict[str, Any]]) – current node validation errors
current_level (int, optional) – current level number (Default value = 1)
- Yields:
Property – error messages from error tree
ahriman.core.formatters.version_printer module
- class VersionPrinter(title: str, packages: dict[str, str])
Bases:
StringPrinter
print content of the python package versions
- packages
map of package name to its version
- Type:
dict[str, str]
default constructor
- Parameters:
title (str) – title of the message
packages (dict[str, str]) – map of package name to its version