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

Formatting functions for informational, warning and error messages ar… #18

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

iberkun
Copy link
Contributor

@iberkun iberkun commented Jun 9, 2021

The known message types are: Informational (Info), Warning and Error. With this change, methods for consistent console display is provided for those message types.

from colorama import Fore
from colorama import Style
from colorama import init
init(autoreset=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend referring to this as colorama.init as in the init_color_console method so we avoid confusion about what init is being used.

I also think that we should move this to the call to colorama.init() in the init_color_console method and then call this method at the start of any command that uses these print methods

@iberkun iberkun force-pushed the format_output_messages branch from 65c9044 to e5fccaa Compare June 11, 2021 16:50
"""
Displays informational message with (default) or without header.
"""
init_color_console("init")
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameter for this function is force_color_output and is a binary. Why are we passing in the string 'init' this will not work as intended. Note that the use of this function takes in the color argument you can see this in use in the log command.
We must update this function to take in a parameter for forcing color output and pass it through to the init_color_console command. We can assign this parameter a default value so that if not passed it is None.

"""
Displays warning message with (default) or without header.
"""
init_color_console("init")
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameter for this function is force_color_output and is a binary. Why are we passing in the string 'init' this will not work as intended. Note that the use of this function takes in the color argument you can see this in use in the log command.
We must update this function to take in a parameter for forcing color output and pass it through to the init_color_console command. We can assign this parameter a default value so that if not passed it is None.

"""
Displays error message with (default) or without header.
"""
init_color_console("init")
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameter for this function is force_color_output and is a binary. Why are we passing in the string 'init' this will not work as intended. Note that the use of this function takes in the color argument you can see this in use in the log command.
We must update this function to take in a parameter for forcing color output and pass it through to the init_color_console command. We can assign this parameter a default value so that if not passed it is None.

@ashedesimone ashedesimone merged commit 4be1bc9 into tianocore:main Jun 29, 2021
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.

2 participants