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:
@@ -111,7 +111,8 @@ class MainWindow(ctk.CTk):
|
|||||||
Returns:
|
Returns:
|
||||||
Path to user config file, or None if not found.
|
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
|
# 1. Check for user config at project root
|
||||||
user_config = app_dir / "config.yaml"
|
user_config = app_dir / "config.yaml"
|
||||||
@@ -139,7 +140,8 @@ class MainWindow(ctk.CTk):
|
|||||||
Returns:
|
Returns:
|
||||||
Path to user config file.
|
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 = app_dir / "config.yaml"
|
||||||
config_path.parent.mkdir(parents=True, exist_ok=True)
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
return config_path
|
return config_path
|
||||||
|
|||||||
Reference in New Issue
Block a user