change(python): put pkgbase routes & impl into their own modules

Introduces new router:
- `aurweb.routers.pkgbase`

Introduces new package:
- `aurweb.pkgbase`

Introduces new modules:
- `aurweb.pkgbase.actions`
- `aurweb.pkgbase.util`

Changes:
- `pkgbase_{action}_instance` functions are now located in
  `aurweb.pkgbase.actions`.
- `pkgbase`-wise routes have been moved to
  `aurweb.routers.pkgbase`.
- `make_single_context` was moved to
  `aurweb.pkgbase.util.make_context`.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-01 20:09:22 -08:00
parent c735f9868b
commit bd2ad9b616
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
6 changed files with 910 additions and 777 deletions

View file

@ -21,7 +21,7 @@ from aurweb.auth import BasicAuthBackend
from aurweb.db import get_engine, query
from aurweb.models import AcceptedTerm, Term
from aurweb.prometheus import http_api_requests_total, http_requests_total, instrumentator
from aurweb.routers import accounts, auth, html, packages, rpc, rss, sso, trusted_user
from aurweb.routers import accounts, auth, html, packages, pkgbase, rpc, rss, sso, trusted_user
from aurweb.templates import make_context, render_template
# Setup the FastAPI app.
@ -81,6 +81,7 @@ async def app_startup():
app.include_router(trusted_user.router)
app.include_router(rss.router)
app.include_router(packages.router)
app.include_router(pkgbase.router)
app.include_router(rpc.router)
# Initialize the database engine and ORM.