config-cli-gui 0.3.5__tar.gz → 0.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/HISTORY.md +7 -0
- {config_cli_gui-0.3.5/src/config_cli_gui.egg-info → config_cli_gui-0.3.6}/PKG-INFO +1 -1
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/_version.py +3 -3
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/config.py +13 -3
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6/src/config_cli_gui.egg-info}/PKG-INFO +1 -1
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui.egg-info/SOURCES.txt +2 -0
- config_cli_gui-0.3.6/src/config_cli_gui.egg-info/scm_file_list.json +80 -0
- config_cli_gui-0.3.6/src/config_cli_gui.egg-info/scm_version.json +8 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/cli/cli_example.py +4 -4
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/config/config_example.py +10 -2
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/gui/gui_example.py +24 -6
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/test_cli.py +2 -2
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/test_generic_cli.py +5 -5
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/FUNDING.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/actions/setup-environment/action.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/dependabot.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/init.sh +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/release_message.sh +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/update_funding.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/workflows/main.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/workflows/release.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.github/workflows/update_readme.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.gitignore +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.idea/runConfigurations/config_generate.xml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.idea/runConfigurations/example_project_cli.xml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.idea/runConfigurations/example_project_gui.xml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.pre-commit-config.yaml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.readthedocs.yaml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/LICENSE +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/Makefile +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/README.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/config.yaml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/.nav.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/_static/img/favicon.png +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/_static/img/logo.png +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/_static/img/settings_dlg.png +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/_static/img/settings_doc.png +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/css/custom.css +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/develop/contributing.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/develop/make_windows.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/develop/naming_convention.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/funding/funding.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/getting-started/install.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/getting-started/virtual-environment.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/index.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/usage/cli.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/docs/usage/config.md +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/mkdocs.yml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/pyproject.toml +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/scripts/show_filelist.ps1 +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/scripts/show_tree.ps1 +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/scripts/show_tree.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/scripts/update_readme.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/setup.cfg +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/cli.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/configtypes/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/configtypes/color.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/configtypes/font.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/configtypes/vector.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/docs.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/gui.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/logging.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui/persistence.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui.egg-info/dependency_links.txt +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui.egg-info/entry_points.txt +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui.egg-info/requires.txt +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui.egg-info/top_level.txt +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/template.yml.url +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/__main__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/cli/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/cli/__main__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/config/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/core/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/core/base.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/example.gpx +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/gui/__init__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/gui/__main__.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/test_config_manager.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/test_docs.py +0 -0
- {config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/uv.lock +0 -0
|
@@ -4,6 +4,13 @@ Changelog
|
|
|
4
4
|
|
|
5
5
|
(unreleased)
|
|
6
6
|
------------
|
|
7
|
+
- Dynamically set app name for config persistence. [Paul Magister]
|
|
8
|
+
- Dynamically set app name for config persistence. [Paul Magister]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
0.3.5 (2026-06-18)
|
|
12
|
+
------------------
|
|
13
|
+
- Docs: Update HISTORY.md for release 0.3.5. [Paul Magister]
|
|
7
14
|
- Improve gui. [Paul Magister]
|
|
8
15
|
- Fix gui log issue: even better fix. [Paul Magister]
|
|
9
16
|
- Fix gui log issue: [Paul Magister]
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.3.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 3,
|
|
21
|
+
__version__ = version = '0.3.6'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 3, 6)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g7d530e99f'
|
|
@@ -190,6 +190,8 @@ class ConfigManager:
|
|
|
190
190
|
self._categories: dict[str, ConfigCategory] = {}
|
|
191
191
|
self._serializer = ConfigSerializer()
|
|
192
192
|
self.app: AppConfig = AppConfig()
|
|
193
|
+
# provide a default hook for application name retrieval; projects may
|
|
194
|
+
# override `get_app_name` on their concrete ConfigManager subclass.
|
|
193
195
|
|
|
194
196
|
categories = (self.app, *categories)
|
|
195
197
|
for category in categories:
|
|
@@ -202,6 +204,14 @@ class ConfigManager:
|
|
|
202
204
|
|
|
203
205
|
self.apply_overrides(overrides)
|
|
204
206
|
|
|
207
|
+
def get_app_name(self) -> str:
|
|
208
|
+
"""Return the application identifier used by persistence helpers.
|
|
209
|
+
|
|
210
|
+
Projects can override this method in their concrete ConfigManager to
|
|
211
|
+
provide a different name "my-app-name"
|
|
212
|
+
"""
|
|
213
|
+
return "config-cli-gui"
|
|
214
|
+
|
|
205
215
|
def add_category(self, name: str, category: ConfigCategory) -> None:
|
|
206
216
|
"""Register a new configuration category."""
|
|
207
217
|
self._categories[name] = category
|
|
@@ -242,7 +252,7 @@ class ConfigManager:
|
|
|
242
252
|
# Persist the information about the last used configuration file so the
|
|
243
253
|
# application can restore the same config on next start.
|
|
244
254
|
try:
|
|
245
|
-
persistence.write_last_used_config(
|
|
255
|
+
persistence.write_last_used_config(self.get_app_name(), str(path))
|
|
246
256
|
except Exception:
|
|
247
257
|
# Persistence should not break normal config loading.
|
|
248
258
|
pass
|
|
@@ -291,7 +301,7 @@ class ConfigManager:
|
|
|
291
301
|
|
|
292
302
|
# Record the saved config as the last-used config as well.
|
|
293
303
|
try:
|
|
294
|
-
persistence.write_last_used_config(
|
|
304
|
+
persistence.write_last_used_config(self.get_app_name(), str(path))
|
|
295
305
|
except Exception:
|
|
296
306
|
# Ignore persistence failures when saving
|
|
297
307
|
pass
|
|
@@ -307,7 +317,7 @@ class ConfigManager:
|
|
|
307
317
|
This is a convenience wrapper around persistence.read_last_used_config.
|
|
308
318
|
"""
|
|
309
319
|
try:
|
|
310
|
-
return persistence.read_last_used_config(
|
|
320
|
+
return persistence.read_last_used_config(self.get_app_name())
|
|
311
321
|
except Exception:
|
|
312
322
|
return None
|
|
313
323
|
|
|
@@ -58,6 +58,8 @@ src/config_cli_gui.egg-info/SOURCES.txt
|
|
|
58
58
|
src/config_cli_gui.egg-info/dependency_links.txt
|
|
59
59
|
src/config_cli_gui.egg-info/entry_points.txt
|
|
60
60
|
src/config_cli_gui.egg-info/requires.txt
|
|
61
|
+
src/config_cli_gui.egg-info/scm_file_list.json
|
|
62
|
+
src/config_cli_gui.egg-info/scm_version.json
|
|
61
63
|
src/config_cli_gui.egg-info/top_level.txt
|
|
62
64
|
src/config_cli_gui/configtypes/__init__.py
|
|
63
65
|
src/config_cli_gui/configtypes/color.py
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".pre-commit-config.yaml",
|
|
4
|
+
"README.md",
|
|
5
|
+
"uv.lock",
|
|
6
|
+
"Makefile",
|
|
7
|
+
"LICENSE",
|
|
8
|
+
"pyproject.toml",
|
|
9
|
+
"mkdocs.yml",
|
|
10
|
+
"HISTORY.md",
|
|
11
|
+
"template.yml.url",
|
|
12
|
+
"config.yaml",
|
|
13
|
+
".gitignore",
|
|
14
|
+
".readthedocs.yaml",
|
|
15
|
+
"scripts/show_filelist.ps1",
|
|
16
|
+
"scripts/show_tree.ps1",
|
|
17
|
+
"scripts/show_tree.py",
|
|
18
|
+
"scripts/update_readme.py",
|
|
19
|
+
"docs/.nav.yml",
|
|
20
|
+
"docs/index.md",
|
|
21
|
+
"docs/develop/contributing.md",
|
|
22
|
+
"docs/develop/make_windows.md",
|
|
23
|
+
"docs/develop/naming_convention.md",
|
|
24
|
+
"docs/funding/funding.md",
|
|
25
|
+
"docs/css/custom.css",
|
|
26
|
+
"docs/_static/img/logo.png",
|
|
27
|
+
"docs/_static/img/favicon.png",
|
|
28
|
+
"docs/_static/img/settings_dlg.png",
|
|
29
|
+
"docs/_static/img/settings_doc.png",
|
|
30
|
+
"docs/usage/config.md",
|
|
31
|
+
"docs/usage/cli.md",
|
|
32
|
+
"docs/getting-started/virtual-environment.md",
|
|
33
|
+
"docs/getting-started/install.md",
|
|
34
|
+
"src/__init__.py",
|
|
35
|
+
"src/config_cli_gui/__init__.py",
|
|
36
|
+
"src/config_cli_gui/config.py",
|
|
37
|
+
"src/config_cli_gui/docs.py",
|
|
38
|
+
"src/config_cli_gui/logging.py",
|
|
39
|
+
"src/config_cli_gui/persistence.py",
|
|
40
|
+
"src/config_cli_gui/cli.py",
|
|
41
|
+
"src/config_cli_gui/gui.py",
|
|
42
|
+
"src/config_cli_gui/configtypes/__init__.py",
|
|
43
|
+
"src/config_cli_gui/configtypes/color.py",
|
|
44
|
+
"src/config_cli_gui/configtypes/vector.py",
|
|
45
|
+
"src/config_cli_gui/configtypes/font.py",
|
|
46
|
+
"tests/__init__.py",
|
|
47
|
+
"tests/test_docs.py",
|
|
48
|
+
"tests/test_config_manager.py",
|
|
49
|
+
"tests/test_cli.py",
|
|
50
|
+
"tests/test_generic_cli.py",
|
|
51
|
+
"tests/example_project/__init__.py",
|
|
52
|
+
"tests/example_project/example.gpx",
|
|
53
|
+
"tests/example_project/__main__.py",
|
|
54
|
+
"tests/example_project/core/__init__.py",
|
|
55
|
+
"tests/example_project/core/base.py",
|
|
56
|
+
"tests/example_project/config/__init__.py",
|
|
57
|
+
"tests/example_project/config/config_example.py",
|
|
58
|
+
"tests/example_project/cli/__init__.py",
|
|
59
|
+
"tests/example_project/cli/cli_example.py",
|
|
60
|
+
"tests/example_project/cli/__main__.py",
|
|
61
|
+
"tests/example_project/gui/__init__.py",
|
|
62
|
+
"tests/example_project/gui/gui_example.py",
|
|
63
|
+
"tests/example_project/gui/__main__.py",
|
|
64
|
+
".idea/runConfigurations/example_project_cli.xml",
|
|
65
|
+
".idea/runConfigurations/config_generate.xml",
|
|
66
|
+
".idea/runConfigurations/example_project_gui.xml",
|
|
67
|
+
".github/PULL_REQUEST_TEMPLATE.md",
|
|
68
|
+
".github/init.sh",
|
|
69
|
+
".github/update_funding.py",
|
|
70
|
+
".github/dependabot.yml",
|
|
71
|
+
".github/FUNDING.yml",
|
|
72
|
+
".github/release_message.sh",
|
|
73
|
+
".github/actions/setup-environment/action.yml",
|
|
74
|
+
".github/ISSUE_TEMPLATE/bug_report.md",
|
|
75
|
+
".github/ISSUE_TEMPLATE/feature_request.md",
|
|
76
|
+
".github/workflows/main.yml",
|
|
77
|
+
".github/workflows/release.yml",
|
|
78
|
+
".github/workflows/update_readme.yml"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
@@ -7,11 +7,11 @@ from logging import Logger
|
|
|
7
7
|
|
|
8
8
|
from config_cli_gui.cli import CliGenerator
|
|
9
9
|
from config_cli_gui.logging import initialize_logging
|
|
10
|
-
from tests.example_project.config.config_example import
|
|
10
|
+
from tests.example_project.config.config_example import ConfigParameterManager
|
|
11
11
|
from tests.example_project.core.base import BaseGPXProcessor
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def validate_config(config_manager:
|
|
14
|
+
def validate_config(config_manager: ConfigParameterManager, logger: Logger) -> bool:
|
|
15
15
|
"""Validate the configuration parameters.
|
|
16
16
|
|
|
17
17
|
Args:
|
|
@@ -29,7 +29,7 @@ def validate_config(config_manager: ProjectConfigManager, logger: Logger) -> boo
|
|
|
29
29
|
return True
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
def run_main_processing(_config:
|
|
32
|
+
def run_main_processing(_config: ConfigParameterManager, logger: Logger) -> int:
|
|
33
33
|
"""Main processing function that gets called by the CLI generator.
|
|
34
34
|
|
|
35
35
|
Args:
|
|
@@ -71,7 +71,7 @@ def run_main_processing(_config: ProjectConfigManager, logger: Logger) -> int:
|
|
|
71
71
|
def main():
|
|
72
72
|
"""Main entry point for the CLI application."""
|
|
73
73
|
# Create the base configuration manager
|
|
74
|
-
config_manager =
|
|
74
|
+
config_manager = ConfigParameterManager()
|
|
75
75
|
|
|
76
76
|
# Initialize logging and get a logger
|
|
77
77
|
logger_manager = initialize_logging(
|
{config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/tests/example_project/config/config_example.py
RENAMED
|
@@ -164,7 +164,7 @@ class MiscConfig(ConfigCategory):
|
|
|
164
164
|
)
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
class
|
|
167
|
+
class ConfigParameterManager(ConfigManager): # Inherit from ConfigManager
|
|
168
168
|
"""Main configuration manager that handles all parameter categories."""
|
|
169
169
|
|
|
170
170
|
cli: CliConfig
|
|
@@ -176,13 +176,21 @@ class ProjectConfigManager(ConfigManager): # Inherit from ConfigManager
|
|
|
176
176
|
categories = (CliConfig(), GuiConfig(), MiscConfig())
|
|
177
177
|
super().__init__(categories, config_file, **kwargs)
|
|
178
178
|
|
|
179
|
+
def get_app_name(self) -> str:
|
|
180
|
+
"""Return the application identifier for this example project.
|
|
181
|
+
|
|
182
|
+
This overrides the library default so that example files use
|
|
183
|
+
"example-app" as their persistence directory/name.
|
|
184
|
+
"""
|
|
185
|
+
return "example-app"
|
|
186
|
+
|
|
179
187
|
|
|
180
188
|
def main():
|
|
181
189
|
"""Main function to generate config file and documentation."""
|
|
182
190
|
default_config: str = "config.yaml"
|
|
183
191
|
default_cli_doc: str = "docs/usage/cli.md"
|
|
184
192
|
default_config_doc: str = "docs/usage/config.md"
|
|
185
|
-
_config =
|
|
193
|
+
_config = ConfigParameterManager()
|
|
186
194
|
doc_gen = DocumentationGenerator(_config)
|
|
187
195
|
doc_gen.generate_default_config_file(output_file=default_config)
|
|
188
196
|
print(f"Generated: {default_config}")
|
|
@@ -27,7 +27,7 @@ from config_cli_gui.logging import (
|
|
|
27
27
|
initialize_logging,
|
|
28
28
|
)
|
|
29
29
|
from config_cli_gui.persistence import read_last_used_config
|
|
30
|
-
from tests.example_project.config.config_example import
|
|
30
|
+
from tests.example_project.config.config_example import ConfigParameterManager
|
|
31
31
|
from tests.example_project.core.base import BaseGPXProcessor
|
|
32
32
|
|
|
33
33
|
|
|
@@ -118,7 +118,7 @@ class MainGui:
|
|
|
118
118
|
self.root.geometry("1200x600") # Increased width for new layout
|
|
119
119
|
|
|
120
120
|
# Initialize configuration
|
|
121
|
-
self._config =
|
|
121
|
+
self._config = ConfigParameterManager("config.yaml")
|
|
122
122
|
|
|
123
123
|
# Initialize logging system using individual AppConfig values
|
|
124
124
|
self.logger_manager = initialize_logging(
|
|
@@ -278,7 +278,8 @@ class MainGui:
|
|
|
278
278
|
# File menu
|
|
279
279
|
file_menu = tk.Menu(menubar, tearoff=0)
|
|
280
280
|
menubar.add_cascade(label="File", menu=file_menu)
|
|
281
|
-
file_menu.add_command(label="
|
|
281
|
+
file_menu.add_command(label="Select config file", command=self._select_config)
|
|
282
|
+
file_menu.add_command(label="Open gpx files...", command=self._open_files)
|
|
282
283
|
file_menu.add_separator()
|
|
283
284
|
|
|
284
285
|
# Create Run menu options dynamically
|
|
@@ -379,6 +380,23 @@ class MainGui:
|
|
|
379
380
|
self.logger.error(f"Could not open file {file_path}: {e}")
|
|
380
381
|
messagebox.showerror("Error", f"Could not open file {file_path}: {e}")
|
|
381
382
|
|
|
383
|
+
def _select_config(self):
|
|
384
|
+
"""Open file dialog to select and load a new config file."""
|
|
385
|
+
config_file = filedialog.askopenfilename(
|
|
386
|
+
title="Select config file",
|
|
387
|
+
filetypes=[("YAML files", "*.yaml"), ("All files", "*.*")],
|
|
388
|
+
)
|
|
389
|
+
if not config_file:
|
|
390
|
+
self.logger.debug("No config file selected.")
|
|
391
|
+
return
|
|
392
|
+
|
|
393
|
+
self.logger.info(f"Loading new configuration from: {config_file}")
|
|
394
|
+
try:
|
|
395
|
+
self._config = ConfigParameterManager(config_file)
|
|
396
|
+
except Exception as e:
|
|
397
|
+
self.logger.error(f"Failed to load config file: {e}", exc_info=True)
|
|
398
|
+
messagebox.showerror("Config Error", f"Failed to load configuration: {e}")
|
|
399
|
+
|
|
382
400
|
def _open_files(self):
|
|
383
401
|
"""Open file dialog and add files to list."""
|
|
384
402
|
files = filedialog.askopenfilenames(
|
|
@@ -558,11 +576,11 @@ def main():
|
|
|
558
576
|
|
|
559
577
|
# Try to restore the last used configuration file so the GUI can start
|
|
560
578
|
# with the user's preferred theme and settings.
|
|
561
|
-
last = read_last_used_config("
|
|
579
|
+
last = read_last_used_config("example-app")
|
|
562
580
|
if last and Path(last).exists():
|
|
563
|
-
_config =
|
|
581
|
+
_config = ConfigParameterManager(last)
|
|
564
582
|
else:
|
|
565
|
-
_config =
|
|
583
|
+
_config = ConfigParameterManager()
|
|
566
584
|
|
|
567
585
|
theme_choice = _config.app.theme.value
|
|
568
586
|
|
|
@@ -4,7 +4,7 @@ from unittest.mock import mock_open, patch
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
6
6
|
from config_cli_gui.cli import CliGenerator
|
|
7
|
-
from tests.example_project.config.config_example import
|
|
7
|
+
from tests.example_project.config.config_example import ConfigParameterManager
|
|
8
8
|
|
|
9
9
|
# ----------------------------------------------------------------------
|
|
10
10
|
# Mock config.yaml content
|
|
@@ -29,7 +29,7 @@ cli:
|
|
|
29
29
|
# ----------------------------------------------------------------------
|
|
30
30
|
@pytest.fixture
|
|
31
31
|
def config_manager():
|
|
32
|
-
return
|
|
32
|
+
return ConfigParameterManager()
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
@pytest.fixture
|
|
@@ -9,7 +9,7 @@ import unittest
|
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
11
|
from config_cli_gui.docs import DocumentationGenerator
|
|
12
|
-
from tests.example_project.config.config_example import
|
|
12
|
+
from tests.example_project.config.config_example import ConfigParameterManager
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class TestGenericCLI(unittest.TestCase):
|
|
@@ -25,7 +25,7 @@ class TestGenericCLI(unittest.TestCase):
|
|
|
25
25
|
self.dummy_input.write_text("dummy input content")
|
|
26
26
|
|
|
27
27
|
# Default config for testing
|
|
28
|
-
self.configManager =
|
|
28
|
+
self.configManager = ConfigParameterManager()
|
|
29
29
|
self.default_cli_config = self.configManager.to_dict()["cli"]
|
|
30
30
|
|
|
31
31
|
def tearDown(self):
|
|
@@ -65,13 +65,13 @@ class TestGenericCLI(unittest.TestCase):
|
|
|
65
65
|
non_existent_file = self.temp_path / "does_not_exist.yaml"
|
|
66
66
|
|
|
67
67
|
with self.assertRaises(FileNotFoundError):
|
|
68
|
-
|
|
68
|
+
ConfigParameterManager(config_file=str(non_existent_file))
|
|
69
69
|
|
|
70
70
|
def test_generate_default_config_file(self):
|
|
71
71
|
"""Test generation of default configuration file."""
|
|
72
72
|
output_file = self.temp_path / "default_config.yaml"
|
|
73
73
|
|
|
74
|
-
config_manager =
|
|
74
|
+
config_manager = ConfigParameterManager()
|
|
75
75
|
docGen = DocumentationGenerator(config_manager)
|
|
76
76
|
docGen.generate_default_config_file(str(output_file))
|
|
77
77
|
|
|
@@ -102,7 +102,7 @@ class TestGenericCLI(unittest.TestCase):
|
|
|
102
102
|
"""Test generation of CLI markdown documentation."""
|
|
103
103
|
output_file = self.temp_path / "cli_doc_test.md"
|
|
104
104
|
|
|
105
|
-
config_manager =
|
|
105
|
+
config_manager = ConfigParameterManager()
|
|
106
106
|
docGen = DocumentationGenerator(config_manager)
|
|
107
107
|
docGen.generate_cli_markdown_doc(str(output_file))
|
|
108
108
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.idea/runConfigurations/example_project_cli.xml
RENAMED
|
File without changes
|
{config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/.idea/runConfigurations/example_project_gui.xml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{config_cli_gui-0.3.5 → config_cli_gui-0.3.6}/src/config_cli_gui.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|