From a71c262307718485ebedb1706f93ba6723f3e57f Mon Sep 17 00:00:00 2001 From: agessaman Date: Mon, 18 May 2026 21:20:51 -0700 Subject: [PATCH] refactor(web_viewer): update project root path for subprocess execution Adjusts the project root path calculation in `app.py` to accommodate changes in how the script is executed as a subprocess. This ensures proper imports of shared and module components without affecting existing functionality. --- web_viewer/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web_viewer/app.py b/web_viewer/app.py index 3149645..70a27ad 100644 --- a/web_viewer/app.py +++ b/web_viewer/app.py @@ -19,10 +19,10 @@ from pathlib import Path from typing import Any from urllib.parse import urlparse -# When started as a script (`python modules/web_viewer/app.py`), Python puts the -# script's directory on sys.path, not the repo root — import modules.* fails -# unless we prepend the project root first. -_project_root = str(Path(__file__).resolve().parent.parent.parent) +# When started as a subprocess (`python web_viewer/app.py`), Python puts the +# script's directory on sys.path, not the repo root — imports of shared.* and +# modules.* fail unless we prepend the project root first. +_project_root = str(Path(__file__).resolve().parent.parent) if _project_root not in sys.path: sys.path.insert(0, _project_root)