feat(launcher): add Tk-based launcher command and wrapper script#2769
feat(launcher): add Tk-based launcher command and wrapper script#2769xxhoeckyxx wants to merge 23 commits into
Conversation
WHAT: Refactor FileEntry. In the former model, a source code element was always either a function or a class. In the changed model, a source code element can be anything. It is therefore no longer reasonable to hardcode attributes function and clazz. Rather describe it as optional element string and mandatory id. This change only affects the inner representation. SDoc syntax still uses the old FUNCTION:/CLASS: fields for backwards compatibility. WHY: There are multiple reasons for this change: - We want to reference more element kinds, not only functions and classes (say macros, structs, enums in C). The kinds are language specific and shall be easily extensible for StrictDoc. - Some languages like Rust have a single namespace for all elements. For example, if we say "file.c:foo" in C, there could be a struct foo and a function void foo() in the same file. In Rust, no such overload is allowed. In consequence, it is possible to infer the kind from the identifier. - Prepare ground for upcoming markdown forward relations, that shall use the element/id form right from the start.
WHY: This option is deprecated some time ago in favour of the `--filter-nodes` option.
…en diffing in/out folders WHY: Ensures that the test diffing works correctly and the __pycache__ folder does not get in the way. HOW: Extracted from strictdoc-project#2766.
WHY: See the code comment.
…islav/remove_filter_requirements chore: remove legacy --filter-requirements option
…islav/test_exceptions fix(tests/end2end): End2EndTestSetup: skip __pycache__ directories when diffing in/out folders
…islaw/ci chore(.github): enable Python 3.14 on some jobs
…islav/test_exception chore(tests/end2end): server: handle exceptions in __enter__()
…islav/wwh docs: add WHAT-WHY-HOW training material
…mbase WHY: Coverage is taking quite some time to load and is not needed for normal test runs.
…islav/pytest_coverage chore(tasks): test_unit: disable coverage by default, disable seleniumbase
…islav/element_and_id refactor(sdoc): change FileEntry from function/clazz to element/id
…islav/element_and_id test(source_code_traceability): add itest for new ELEMENT/ID syntax
…xx/strictdoc into derhoecki/feat/launcher
Co-authored-by: Copilot <copilot@github.com>
stanislaw
left a comment
There was a problem hiding this comment.
Please rebase (instead of merge) this branch against the latest main branch and squash all your commits to just one. Otherwise, it is harder to review the overall changeset.
When the branch is rebase/squashed to just one commit with your actual change, I will do the next round of review. For now, I left some very obvious comments.
| @@ -0,0 +1,152 @@ | |||
| import subprocess | |||
There was a problem hiding this comment.
Let's consolidate the entire Launcher codebase in the folder strictdoc/features/launcher. This should apply to all files from this PR that are related to this feature.
|
|
||
|
|
||
| def _ensure_git_workspace(self) -> bool: | ||
| if not self._ensure_workspace(): |
There was a problem hiding this comment.
You should be running invoke lint locally to make sure that your Python files have correct indentation. See the Dev Guide about this and other things.
| messagebox.showerror("Git error", str(exc)) | ||
| return False | ||
|
|
||
| if completed.returncode != 0 or completed.stdout.strip().lower() != "true": |
There was a problem hiding this comment.
Instead of extracting this Git-related functionality to a separate file, let's keep it inside your main launcher.py for now. The file will be bigger but I prefer to have separate files where their interfaces are clearly separated. The issue with this file is that it seems to be about Git but in fact it is still coupled to UI-relevant things like messagebox.showerror etc.
There was a problem hiding this comment.
This role was ultimately not suitable for our company, so I moved it to a separate file. That way, it’s easier to comment it out or remove it. Maybe I could rename the feature to something more descriptive so it’s clear that it’s part of the user interface, or should we just remove this feature entirely? Or move all UI files to a separate folder, as you suggested in your post above. Just let me know what you prefer, and I’ll adjust it accordingly ;)
| @@ -0,0 +1,11 @@ | |||
| """Thin wrapper to launch the Tk-based StrictDoc launcher. | |||
There was a problem hiding this comment.
Is this file actually needed?
How is it planned to be used?
There was a problem hiding this comment.
This file was actually intended to serve as a wrapper for a command-line argument—unfortunately, I simply forgot to remove it—the wrapper for the command-line argument is now located in “commands/launcher_command.py”
ttk Combobox now had recent_workspaces with a length of 5 entries Co-authored-by: Copilot <copilot@github.com>
added color in Logs Co-authored-by: Copilot <copilot@github.com>
…oved because it is no longer needed. - The launcher has been moved to a separate feature folder.
GUI Launcher: Start/Stop Server, Exports, Logs & Project Config
Hello everyone,
this is a third proposal featuring a slightly more substantial addition 🙂
I’ve developed an additional GUI launcher using tkinter that allows users to start and stop the server via a graphical user interface.
It also provides a file export feature, where both the export path and the file format can be selected.
Background
At the moment, the server runs locally on every user’s machine, and not everyone feels comfortable working with the command line.
The launcher is intended to provide a simple and user-friendly alternative.
Additional Features
The GUI also allows users to:
As always, feedback is very welcome 🙂
Best regards,
Christopher