aboutsummaryrefslogtreecommitdiffstats
path: root/backend/route_manager.py
diff options
context:
space:
mode:
authorGravatar decorator-factory <[email protected]>2020-12-15 09:30:53 +0300
committerGravatar decorator-factory <[email protected]>2020-12-15 09:36:48 +0300
commitfc04997fa483464d5daee52a9d70745df555f5b1 (patch)
tree1cbfdd2219c56c4cf8f5a590ad2e72cf3b63bc75 /backend/route_manager.py
parentMerge branch 'ks123/routes-parsing' into testing-strategies (diff)
Fix f-string referencing the wrong nametesting-strategies
Fix missing type annotation Lint fix
Diffstat (limited to 'backend/route_manager.py')
-rw-r--r--backend/route_manager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/route_manager.py b/backend/route_manager.py
index c48ea8e..031c9b3 100644
--- a/backend/route_manager.py
+++ b/backend/route_manager.py
@@ -36,7 +36,7 @@ def route_classes() -> t.Iterator[tuple[Path, type[Route]]]:
routes_directory = Path("backend") / "routes"
for module_path in routes_directory.rglob("*.py"):
- import_name = f"{'.'.join(file.parent.parts)}.{file.stem}"
+ import_name = f"{'.'.join(module_path.parent.parts)}.{module_path.stem}"
route_module = importlib.import_module(import_name)
for _member_name, member in inspect.getmembers(route_module):
if is_route_class(member):
@@ -50,7 +50,7 @@ def create_route_map() -> list[BaseRoute]:
for module_path, member in route_classes():
# module_path == Path("backend/routes/foo/bar/baz/bin.py")
# => levels == ["foo", "bar", "baz"]
- levels = file.parent.parts[2:]
+ levels = module_path.parent.parts[2:]
current_level = None
for level in levels:
if current_level is None: