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
This commit is contained in:
Jeremy Shen
2026-06-10 11:50:14 +08:00
parent 8f83fa9eae
commit 1ad2dcdeb9
+4 -2
View File
@@ -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