From 58e702213df0addc3dae3a64d9feafca7cceaa8f Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Fri, 15 Dec 2023 14:45:07 +0200 Subject: [PATCH] docs: restore docs for the view --- docs/ahriman.web.views.rst | 8 ++++++++ package/share/bash-completion/completions/_ahriman | 9 +++++++++ src/ahriman/application/application/application.py | 2 +- src/ahriman/application/handlers/patch.py | 2 +- src/ahriman/application/handlers/validate.py | 2 +- src/ahriman/core/tree.py | 2 +- src/ahriman/models/package.py | 2 +- src/ahriman/models/repository_paths.py | 4 ++-- src/ahriman/models/waiter.py | 2 +- src/ahriman/web/views/base.py | 2 +- src/ahriman/web/views/status_view_guard.py | 5 ++++- 11 files changed, 30 insertions(+), 10 deletions(-) diff --git a/docs/ahriman.web.views.rst b/docs/ahriman.web.views.rst index 0a44ca66..cb8ac889 100644 --- a/docs/ahriman.web.views.rst +++ b/docs/ahriman.web.views.rst @@ -38,6 +38,14 @@ ahriman.web.views.static module :no-undoc-members: :show-inheritance: +ahriman.web.views.status\_view\_guard module +-------------------------------------------- + +.. automodule:: ahriman.web.views.status_view_guard + :members: + :no-undoc-members: + :show-inheritance: + Module contents --------------- diff --git a/package/share/bash-completion/completions/_ahriman b/package/share/bash-completion/completions/_ahriman index 8a35df5c..a62c9ec5 100644 --- a/package/share/bash-completion/completions/_ahriman +++ b/package/share/bash-completion/completions/_ahriman @@ -590,6 +590,15 @@ _set_new_action() { # ${!x} -> ${hello} -> "world" _shtab_ahriman() { local completing_word="${COMP_WORDS[COMP_CWORD]}" + local completed_positional_actions + local current_action + local current_action_args_start_index + local current_action_choices + local current_action_compgen + local current_action_is_positional + local current_action_nargs + local current_option_strings + local sub_parsers COMPREPLY=() local prefix=_shtab_ahriman diff --git a/src/ahriman/application/application/application.py b/src/ahriman/application/application/application.py index e1afa14e..bf8eb593 100644 --- a/src/ahriman/application/application/application.py +++ b/src/ahriman/application/application/application.py @@ -117,7 +117,7 @@ class Application(ApplicationPackages, ApplicationRepository): Returns: list[Package]: updated packages list. Packager for dependencies will be copied from - original package + original package """ def missing_dependencies(source: Iterable[Package]) -> dict[str, str | None]: # append list of known packages with packages which are in current sources diff --git a/src/ahriman/application/handlers/patch.py b/src/ahriman/application/handlers/patch.py index 6e7240b0..0b3f2f51 100644 --- a/src/ahriman/application/handlers/patch.py +++ b/src/ahriman/application/handlers/patch.py @@ -79,7 +79,7 @@ class Patch(Handler): Returns: tuple[str, PkgbuildPatch]: package base and created PKGBUILD patch based on the diff from master HEAD - to current files + to current files """ package = Package.from_build(sources_dir, architecture, None) patch = Sources.patch_create(sources_dir, *track) diff --git a/src/ahriman/application/handlers/validate.py b/src/ahriman/application/handlers/validate.py index 11baa985..60957e52 100644 --- a/src/ahriman/application/handlers/validate.py +++ b/src/ahriman/application/handlers/validate.py @@ -125,7 +125,7 @@ class Validate(Handler): Returns: dict[str, Any]: schema with added elements from source schema if they were set before and not presented - in the new one. Note, that schema will be modified in-place + in the new one. Note, that schema will be modified in-place """ for key, value in source.items(): if key not in schema: diff --git a/src/ahriman/core/tree.py b/src/ahriman/core/tree.py index 3b9a762b..5fe87514 100644 --- a/src/ahriman/core/tree.py +++ b/src/ahriman/core/tree.py @@ -184,7 +184,7 @@ class Tree: Returns: list[list[Package]]: list of packages lists based on their dependencies. The amount of elements in each - sublist is less or equal to ``count`` + sublist is less or equal to ``count`` Raises: PartitionError: in case if it is impossible to divide tree by specified amount of partitions diff --git a/src/ahriman/models/package.py b/src/ahriman/models/package.py index a931521c..98e93d08 100644 --- a/src/ahriman/models/package.py +++ b/src/ahriman/models/package.py @@ -505,7 +505,7 @@ class Package(LazyLogging): Returns: bool: True in case if package was built after the specified date and False otherwise. In case if build date - is not set by any of packages, it returns False + is not set by any of packages, it returns False """ return any( package.build_date > timestamp diff --git a/src/ahriman/models/repository_paths.py b/src/ahriman/models/repository_paths.py index 3cbd9066..d6be0915 100644 --- a/src/ahriman/models/repository_paths.py +++ b/src/ahriman/models/repository_paths.py @@ -75,7 +75,7 @@ class RepositoryPaths(LazyLogging): Returns: Path: relative path which contains only architecture segment in case if legacy tree is used and repository - name and architecture otherwise + name and architecture otherwise """ if not self._force_current_tree: if (self._repository_root / self.repository_id.architecture).is_dir(): @@ -181,7 +181,7 @@ class RepositoryPaths(LazyLogging): Returns: set[str]: list of repository names for which there is created tree. Returns empty set in case if repository - is loaded in legacy mode + is loaded in legacy mode """ # simply walk through the root. In case if there are subdirectories, emit the name def walk(paths: RepositoryPaths) -> Generator[str, None, None]: diff --git a/src/ahriman/models/waiter.py b/src/ahriman/models/waiter.py index aeac0d47..9ad5e1a5 100644 --- a/src/ahriman/models/waiter.py +++ b/src/ahriman/models/waiter.py @@ -49,7 +49,7 @@ class Waiter: Returns: bool: True in case current monotonic time is more than :attr:`start_time` and :attr:`wait_timeout` - doesn't equal to 0 + doesn't equal to 0 """ since_start: float = time.monotonic() - self.start_time return self.wait_timeout != 0 and since_start > self.wait_timeout diff --git a/src/ahriman/web/views/base.py b/src/ahriman/web/views/base.py index 76d88cb0..300ba18a 100644 --- a/src/ahriman/web/views/base.py +++ b/src/ahriman/web/views/base.py @@ -125,7 +125,7 @@ class BaseView(View, CorsViewMixin): Returns: list[str]: list of routes defined for the view. By default, it tries to read :attr:`ROUTES` option if set - and returns empty list otherwise + and returns empty list otherwise """ del configuration return cls.ROUTES diff --git a/src/ahriman/web/views/status_view_guard.py b/src/ahriman/web/views/status_view_guard.py index 708803d1..174cd1a8 100644 --- a/src/ahriman/web/views/status_view_guard.py +++ b/src/ahriman/web/views/status_view_guard.py @@ -21,6 +21,9 @@ from ahriman.core.configuration import Configuration class StatusViewGuard: + """ + helper for check if status routes are enabled + """ ROUTES: list[str] @@ -34,7 +37,7 @@ class StatusViewGuard: Returns: list[str]: list of routes defined for the view. By default, it tries to read :attr:`ROUTES` option if set - and returns empty list otherwise + and returns empty list otherwise """ if configuration.getboolean("web", "service_only", fallback=False): return []