From 120c84418b6c2b06a0b581c2032ca2d247435d15 Mon Sep 17 00:00:00 2001 From: Redume Date: Wed, 18 Sep 2024 17:14:04 +0300 Subject: [PATCH] fix pep8 --- main.py | 1 + src/routes/index.py | 3 ++- src/routes/wallpaper.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 59e4ad6..b75f05d 100644 --- a/main.py +++ b/main.py @@ -18,6 +18,7 @@ app.mount('/.well-known/', StaticFiles(directory='./.well-known/')) async def app_ads(req, __): return FileResponse('./app-ads.txt') + @app.exception_handler(404) async def not_found(req, __): return FileResponse('./src/web/html/error/404.html') \ No newline at end of file diff --git a/src/routes/index.py b/src/routes/index.py index 809d2ff..6e50e08 100644 --- a/src/routes/index.py +++ b/src/routes/index.py @@ -3,6 +3,7 @@ from fastapi.responses import FileResponse router = APIRouter() + @router.get('/') async def main(): - return FileResponse('./src/web/html/index.html') \ No newline at end of file + return FileResponse('./src/web/html/index.html') diff --git a/src/routes/wallpaper.py b/src/routes/wallpaper.py index 5ced5e0..ed86bd1 100644 --- a/src/routes/wallpaper.py +++ b/src/routes/wallpaper.py @@ -8,6 +8,7 @@ router = APIRouter() template = Jinja2Templates(directory='./src/web/html') + @router.get('/wallpaper/{day}', response_class=HTMLResponse) async def wallpaper(request: Request, day): token = '1gI9G84ZafKDEnrbydviGknReOGiVK9jqrQBE3et' @@ -20,4 +21,4 @@ async def wallpaper(request: Request, day): request, '/wallpaper.html', {'info': res.json()} - ) \ No newline at end of file + )