docs: restore docs for the view

This commit is contained in:
Evgenii Alekseev 2023-12-15 14:45:07 +02:00
parent e784032bc6
commit 58e702213d
11 changed files with 30 additions and 10 deletions

View File

@ -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
---------------

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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]:

View File

@ -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

View File

@ -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

View File

@ -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 []