add __all__ attribute

This commit is contained in:
2022-05-03 01:31:21 +03:00
parent b7dca2d797
commit 3d9fae5415
13 changed files with 39 additions and 1 deletions

View File

@ -36,6 +36,9 @@ from ahriman.models.user_identity import UserIdentity
from ahriman.web.middlewares import HandlerType, MiddlewareType
__all__ = ["AuthorizationPolicy", "auth_handler", "setup_auth"]
class AuthorizationPolicy(aiohttp_security.AbstractAuthorizationPolicy): # type: ignore
"""
authorization policy implementation

View File

@ -25,6 +25,9 @@ from logging import Logger
from ahriman.web.middlewares import HandlerType, MiddlewareType
__all__ = ["exception_handler"]
def exception_handler(logger: Logger) -> MiddlewareType:
"""
exception handler middleware. Just log any exception (except for client ones)

View File

@ -33,6 +33,9 @@ from ahriman.web.views.user.login import LoginView
from ahriman.web.views.user.logout import LogoutView
__all__ = ["setup_routes"]
def setup_routes(application: Application, static_path: Path) -> None:
"""
setup all defined routes

View File

@ -33,6 +33,9 @@ from ahriman.web.middlewares.exception_handler import exception_handler
from ahriman.web.routes import setup_routes
__all__ = ["on_shutdown", "on_startup", "run_server", "setup_service"]
async def on_shutdown(application: web.Application) -> None:
"""
web application shutdown handler