Repository navigation
Console EXE for the command line, and colors in Windows consoles - #3
Merged
Merged
Conversation
QuickPRS.exe is a windowed program: a console that starts it does not wait for it or show its output, so `QuickPRS.exe validate radio.PRS` typed in cmd or PowerShell printed nothing. build.py now also builds QuickPRS-cli.exe, a console build with the same modules, and passes extra options (e.g. --workpath) to PyInstaller. Also: the version text and the GUI said 50+ commands (there are 63), and the 1.1.0 changelog takes the release date.
A Windows console prints ANSI codes as text unless the program turns their handling on, so validate and friends showed a left arrow and [1m around every heading in a classic console window. Turn it on for the console (Windows 10 and later) and leave colors out where that fails. NO_COLOR is honored.
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.
Summary
QuickPRS.exeis built as a windowed program. A console neither waits for a windowed program nor shows its output, soQuickPRS.exe validate radio.PRStyped in cmd or PowerShell printed nothing (true since 1.0.0; redirected output still worked).build.pynow also buildsQuickPRS-cli.exe, a console build with the same modules, for the command line. The README says which to use.Classic Windows console windows also showed color codes as text (
←[1maround every heading, frompython -m quickprstoo): a Windows console needs the program to turn ANSI handling on.colors.pynow turns it on, leaves colors out where it cannot, and honorsNO_COLOR.Also: the version text and the GUI said 50+ commands (there are 63), and the 1.1.0 changelog takes the release date.
Testing
tests/test_build_script.py: both builds, same options apart from windowed/console, extra options passed through, output paths reported. Each of five mutations ofbuild.py(including the version on master) fails the test meant for it.TestColorsInWindowsConsoles: seven mutations ofcolors.py, each caught by its test.--version,create,validateandradio scanoutput; color codes no longer show as text.