diff --git a/src/ahriman/core/report/jinja_template.py b/src/ahriman/core/report/jinja_template.py index 91e68b83..e847d010 100644 --- a/src/ahriman/core/report/jinja_template.py +++ b/src/ahriman/core/report/jinja_template.py @@ -35,25 +35,25 @@ class JinjaTemplate: It uses jinja2 templates for report generation, the following variables are allowed: - homepage - link to homepage, string, optional - link_path - prefix fo packages to download, string, required - has_package_signed - True in case if package sign enabled, False otherwise, required - has_repo_signed - True in case if repository database sign enabled, False otherwise, required - packages - sorted list of packages properties, required - * architecture, string - * archive_size, pretty printed size, string - * build_date, pretty printed datetime, string - * depends, sorted list of strings - * description, string - * filename, string, - * groups, sorted list of strings - * installed_size, pretty printed datetime, string - * licenses, sorted list of strings - * name, string - * url, string - * version, string - pgp_key - default PGP key ID, string, optional - repository - repository name, string, required + * homepage - link to homepage, string, optional + * link_path - prefix fo packages to download, string, required + * has_package_signed - True in case if package sign enabled, False otherwise, required + * has_repo_signed - True in case if repository database sign enabled, False otherwise, required + * packages - sorted list of packages properties, required + * architecture, string + * archive_size, pretty printed size, string + * build_date, pretty printed datetime, string + * depends, sorted list of strings + * description, string + * filename, string, + * groups, sorted list of strings + * installed_size, pretty printed datetime, string + * licenses, sorted list of strings + * name, string + * url, string + * version, string + * pgp_key - default PGP key ID, string, optional + * repository - repository name, string, required Attributes: homepage(Optional[str]): homepage link if any (for footer) diff --git a/src/ahriman/web/views/index.py b/src/ahriman/web/views/index.py index 45b83751..e2829980 100644 --- a/src/ahriman/web/views/index.py +++ b/src/ahriman/web/views/index.py @@ -34,30 +34,30 @@ class IndexView(BaseView): It uses jinja2 templates for report generation, the following variables are allowed: - architecture - repository architecture, string, required - auth - authorization descriptor, required - * authenticated - alias to check if user can see the page, boolean, required - * control - HTML to insert for login control, HTML string, required - * enabled - whether authorization is enabled by configuration or not, boolean, required - * username - authenticated username if any, string, null means not authenticated - index_url - url to the repository index, string, optional - packages - sorted list of packages properties, required - * base, string - * depends, sorted list of strings - * groups, sorted list of strings - * licenses, sorted list of strings - * packages, sorted list of strings - * status, string based on enum value - * status_color, string based on enum value - * timestamp, pretty printed datetime, string - * version, string - * web_url, string - repository - repository name, string, required - service - service status properties, required - * status, string based on enum value - * status_color, string based on enum value - * timestamp, pretty printed datetime, string - version - ahriman version, string, required + * architecture - repository architecture, string, required + * auth - authorization descriptor, required + * authenticated - alias to check if user can see the page, boolean, required + * control - HTML to insert for login control, HTML string, required + * enabled - whether authorization is enabled by configuration or not, boolean, required + * username - authenticated username if any, string, null means not authenticated + * index_url - url to the repository index, string, optional + * packages - sorted list of packages properties, required + * base, string + * depends, sorted list of strings + * groups, sorted list of strings + * licenses, sorted list of strings + * packages, sorted list of strings + * status, string based on enum value + * status_color, string based on enum value + * timestamp, pretty printed datetime, string + * version, string + * web_url, string + * repository - repository name, string, required + * service - service status properties, required + * status, string based on enum value + * status_color, string based on enum value + * timestamp, pretty printed datetime, string + * version - ahriman version, string, required Attributes: GET_PERMISSION(UserAccess): (class attribute) get permissions of self diff --git a/src/ahriman/web/views/service/add.py b/src/ahriman/web/views/service/add.py index 7482d01c..2aedb029 100644 --- a/src/ahriman/web/views/service/add.py +++ b/src/ahriman/web/views/service/add.py @@ -38,9 +38,10 @@ class AddView(BaseView): add new package JSON body must be supplied, the following model is used: - { - "packages": "ahriman" # either list of packages or package name as in AUR - } + + >>> { + >>> "packages": "ahriman" # either list of packages or package name as in AUR + >>> } Raises: HTTPBadRequest: if bad data is supplied diff --git a/src/ahriman/web/views/service/remove.py b/src/ahriman/web/views/service/remove.py index 88a25aed..1e3780a7 100644 --- a/src/ahriman/web/views/service/remove.py +++ b/src/ahriman/web/views/service/remove.py @@ -38,9 +38,10 @@ class RemoveView(BaseView): remove existing packages JSON body must be supplied, the following model is used: - { - "packages": "ahriman", # either list of packages or package name - } + + >>> { + >>> "packages": "ahriman", # either list of packages or package name + >>> } Raises: HTTPBadRequest: if bad data is supplied diff --git a/src/ahriman/web/views/service/request.py b/src/ahriman/web/views/service/request.py index f6880729..01d7b885 100644 --- a/src/ahriman/web/views/service/request.py +++ b/src/ahriman/web/views/service/request.py @@ -38,9 +38,10 @@ class RequestView(BaseView): request to add new package JSON body must be supplied, the following model is used: - { - "packages": "ahriman" # either list of packages or package name as in AUR - } + + >>> { + >>> "packages": "ahriman" # either list of packages or package name as in AUR + >>> } Raises: HTTPBadRequest: if bad data is supplied diff --git a/src/ahriman/web/views/status/ahriman.py b/src/ahriman/web/views/status/ahriman.py index 3575cd47..43afc3dd 100644 --- a/src/ahriman/web/views/status/ahriman.py +++ b/src/ahriman/web/views/status/ahriman.py @@ -51,9 +51,10 @@ class AhrimanView(BaseView): update service status JSON body must be supplied, the following model is used: - { - "status": "unknown", # service status string, must be valid `BuildStatusEnum` - } + + >>> { + >>> "status": "unknown", # service status string, must be valid `BuildStatusEnum` + >>> } Raises: HTTPBadRequest: if bad data is supplied diff --git a/src/ahriman/web/views/status/package.py b/src/ahriman/web/views/status/package.py index 4e649bf0..45a11ae2 100644 --- a/src/ahriman/web/views/status/package.py +++ b/src/ahriman/web/views/status/package.py @@ -82,11 +82,12 @@ class PackageView(BaseView): update package build status JSON body must be supplied, the following model is used: - { - "status": "unknown", # package build status string, must be valid `BuildStatusEnum` - "package": {} # package body (use `dataclasses.asdict` to generate one), optional. - # Must be supplied in case if package base is unknown - } + + >>> { + >>> "status": "unknown", # package build status string, must be valid `BuildStatusEnum` + >>> "package": {} # package body (use `dataclasses.asdict` to generate one), optional. + >>> # Must be supplied in case if package base is unknown + >>> } Raises: HTTPBadRequest: if bad data is supplied diff --git a/src/ahriman/web/views/user/login.py b/src/ahriman/web/views/user/login.py index 80766a2e..1199b918 100644 --- a/src/ahriman/web/views/user/login.py +++ b/src/ahriman/web/views/user/login.py @@ -72,10 +72,11 @@ class LoginView(BaseView): login user to service either JSON body or form data must be supplied the following fields are required: - { - "username": "username" # username to use for login - "password": "pa55w0rd" # password to use for login - } + + >>> { + >>> "username": "username" # username to use for login + >>> "password": "pa55w0rd" # password to use for login + >>> } Raises: HTTPFound: on success response