aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-12-15 07:59:18 +0200
committerGravatar GitHub <[email protected]>2020-12-15 07:59:18 +0200
commit2f4d1d80f795bcc9f04ab4f655249ab3a156c792 (patch)
treec02ad920d8045642d03ec6ac4d28e4060ff72ef3
parentAdd ks123 (GH ks129) to CODEOWNERS (diff)
Make import name of route working for every platform
As Windows use \\ instead /, current way doesn't work in Windows, because replacing / with . doesn't do anything with \\. Now this join parent parts instead, what doesn't include separations.
-rw-r--r--backend/route_manager.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/route_manager.py b/backend/route_manager.py
index 25529eb..c162b7a 100644
--- a/backend/route_manager.py
+++ b/backend/route_manager.py
@@ -32,7 +32,7 @@ def create_route_map() -> list:
route_dict = nested_dict()
for file in routes_directory.rglob("*.py"):
- import_name = f"{str(file.parent).replace('/', '.')}.{file.stem}"
+ import_name = f"{'.'.join(file.parent.parts)}.{file.stem}"
route = importlib.import_module(import_name)