Disentangle reusable template logic from qvm-template CLI#409
Draft
eaon wants to merge 12 commits intoQubesOS:mainfrom
Draft
Disentangle reusable template logic from qvm-template CLI#409eaon wants to merge 12 commits intoQubesOS:mainfrom
qvm-template CLI#409eaon wants to merge 12 commits intoQubesOS:mainfrom
Conversation
Refactored to allow to pass a callback function instead of entangling tui assumptions.
…Running to exceptions module
Also renamed clean to clean_cache for clarity.
Author
|
I had avoided uploading my key to keyservers but now did it. Edit: I'll address the lint/test issues in upcoming commits. Converted to draft for now. |
Member
|
Just to confirm: yes, I'm happy with the overall idea of this PR. But all tests need to pass. |
Contributor
|
ping |
Author
|
Hiyah, I'm still planning on getting back to this - technical issues and life got in the way. Should have some time later this week/early next week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This extracts the core template management functionality from
qvm_template.pyinto a newqubesadmin.templatesmodule, separating reusable library code from CLI-specific concerns like argument parsing and terminal output.These changes primarily move code rather than modify it, meaning the logic should not have changed unless that was required for functionality extraction.
The original code had
parser.error()calls scattered throughout, resulting insys.exit(). Functions now signal errors and progress in Python rather than just in stdout/stderr. In short,qvm-template-guicould avoid parsing/showing the cli tool's output, as with this change it could use the module provide native Qt progress bars etc.I did cursory testing (both on the cli and with
qvm-template-gui) and didn't run into issues. Happy to do more if there's interest in merging this but you want more thorough manual testing. I couldn't find an issue that suggested this should happen.