From 10a6b6553d810b1614dc642a6d82bd4ffcaec327 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Sun, 19 Feb 2023 16:27:55 +0400 Subject: [PATCH] Moved files related to paths to a separated directory --- Makefile | 1 + app/main.py | 6 +++--- app/{ => paths}/errors.py | 4 ++-- app/{ => paths}/pages.py | 2 +- app/{ => paths}/paths.py | 0 5 files changed, 7 insertions(+), 6 deletions(-) rename app/{ => paths}/errors.py (95%) rename app/{ => paths}/pages.py (94%) rename app/{ => paths}/paths.py (100%) diff --git a/Makefile b/Makefile index 949d4ba..da86601 100644 --- a/Makefile +++ b/Makefile @@ -16,5 +16,6 @@ docker: clean: rm -rf app/__pycache__ + rm -rf app/paths/__pycache__ rm -rf __pycache__ rm -rf .mypy_cache diff --git a/app/main.py b/app/main.py index 642ebe0..5624ce6 100644 --- a/app/main.py +++ b/app/main.py @@ -5,9 +5,9 @@ from fastapi.staticfiles import StaticFiles from . import common # Add your paths here -from .paths import Paths -from . import pages -from . import errors +from .paths.paths import Paths +from .paths import pages +from .paths import errors paths: List[Type[Paths]] = [ pages.MainPaths, diff --git a/app/errors.py b/app/paths/errors.py similarity index 95% rename from app/errors.py rename to app/paths/errors.py index 3381368..0a0cbd3 100644 --- a/app/errors.py +++ b/app/paths/errors.py @@ -6,8 +6,8 @@ from fastapi import Request, Response from fastapi import HTTPException from . import paths -from . import respond -from . import common +from .. import respond +from .. import common # Add other HTTP error codes codes = [404, 500] diff --git a/app/pages.py b/app/paths/pages.py similarity index 94% rename from app/pages.py rename to app/paths/pages.py index 56c4094..a2aa13e 100644 --- a/app/pages.py +++ b/app/paths/pages.py @@ -3,7 +3,7 @@ from fastapi import Request, Response from . import paths -from . import respond +from .. import respond class MainPaths(paths.Paths): diff --git a/app/paths.py b/app/paths/paths.py similarity index 100% rename from app/paths.py rename to app/paths/paths.py