From 1ad2dcdeb96bc43c9b9427c30565daa974f8b586 Mon Sep 17 00:00:00 2001 From: Jeremy Shen Date: Wed, 10 Jun 2026 11:50:14 +0800 Subject: [PATCH] fix(config): correct path to project root config.yaml - _find_config() and _get_user_config_path() now use parent.parent.parent to navigate from src/gui/main_window.py to project root - User config now saves to /data/work/prj/Zynq_Flasher/config.yaml --- src/gui/main_window.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/main_window.py b/src/gui/main_window.py index 3c49163..fa71de1 100644 --- a/src/gui/main_window.py +++ b/src/gui/main_window.py @@ -111,7 +111,8 @@ class MainWindow(ctk.CTk): Returns: Path to user config file, or None if not found. """ - app_dir = Path(__file__).parent.parent + # Navigate from src/gui/main_window.py -> project root + app_dir = Path(__file__).parent.parent.parent # 1. Check for user config at project root user_config = app_dir / "config.yaml" @@ -139,7 +140,8 @@ class MainWindow(ctk.CTk): Returns: Path to user config file. """ - app_dir = Path(__file__).parent.parent + # Navigate from src/gui/main_window.py -> project root + app_dir = Path(__file__).parent.parent.parent config_path = app_dir / "config.yaml" config_path.parent.mkdir(parents=True, exist_ok=True) return config_path