Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ANSI color code 3 mapping from brown to gold and set bold format processing enabled by default #611

Merged
merged 9 commits into from
Jul 18, 2024

Conversation

jsbautista
Copy link
Contributor

@jsbautista jsbautista commented Jun 25, 2024

After:
image
Fixes #273
Related to spyder-ide/spyder#21225

@jsbautista
Copy link
Contributor Author

Hi @dalthviz can you review this?

Copy link
Collaborator

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jsbautista ! Checked this manually and is working as expected 👍 Just in case, added a suggestion related with the failing test with a possible fix for it.

Also, thinking about tests, probably it could be nice to update the TestAnsiCodeProcessor test class here to also have an instance of QtAnsiCodeProcessor. In that way we could check the actual color that gets rendered over the console. A possible way to achieve that is:

  • Add a qt_processor attribute to the TestAnsiCodeProcessor of type QtAnsiCodeProcessor over the setUp method
  • Use it over the test you modified to check for the color name with something like:
foreground_color = self.processor.foreground_color
self.assertEqual(self.qt_processor.get_color(foreground_color).name(), '#ffd700')

Let me know what you think and if you have any question!

Edit: Also, lets do here the change for the default value to allow bold format and add a test for it. For more details about what needs to be done you can check #273 (comment)

qtconsole/tests/test_ansi_code_processor.py Outdated Show resolved Hide resolved
@dalthviz dalthviz added this to the 5.6.0 milestone Jul 5, 2024
@dalthviz dalthviz changed the title [WIP] PR: Change color 3 to gold [WIP] PR: Change ANSI color code 3 mapping from brown to gold Jul 5, 2024
jsbautista and others added 3 commits July 7, 2024 09:44
Co-authored-by: Daniel Althviz Moré <16781833+dalthviz@users.noreply.github.com>
Co-authored-by: Daniel Althviz Moré <16781833+dalthviz@users.noreply.github.com>
@dalthviz dalthviz changed the title [WIP] PR: Change ANSI color code 3 mapping from brown to gold [WIP] PR: Change ANSI color code 3 mapping from brown to gold and set bold format enabled by default Jul 15, 2024
@dalthviz dalthviz changed the title [WIP] PR: Change ANSI color code 3 mapping from brown to gold and set bold format enabled by default [WIP] PR: Change ANSI color code 3 mapping from brown to gold and set bold format processing enabled by default Jul 15, 2024
@dalthviz
Copy link
Collaborator

Thanks for getting in the suggestions @jsbautista ! Left a single final suggestion to remove some extra blank lines. Also, doing the change to enable bold format by default (following the info at #273 (comment)) needs to be done. Once those two things are done here I would say this should be ready for merging 👍

Just in case, what do you think @ccordoba12 ?

@dalthviz dalthviz changed the title [WIP] PR: Change ANSI color code 3 mapping from brown to gold and set bold format processing enabled by default PR: Change ANSI color code 3 mapping from brown to gold and set bold format processing enabled by default Jul 16, 2024
Copy link
Collaborator

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jsbautista !

Copy link
Collaborator

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too, thanks @jsbautista!

@dalthviz dalthviz merged commit 8f5bcb8 into jupyter:main Jul 18, 2024
22 checks passed
@dalthviz dalthviz changed the title PR: Change ANSI color code 3 mapping from brown to gold and set bold format processing enabled by default Change ANSI color code 3 mapping from brown to gold and set bold format processing enabled by default Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to output boldface and some colors from executing python script in qtconsole.
3 participants