-
Notifications
You must be signed in to change notification settings - Fork 25
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
Conversation
edkrepo/common/ui_functions.py
Outdated
from colorama import Fore | ||
from colorama import Style | ||
from colorama import init | ||
init(autoreset=True) |
There was a problem hiding this comment.
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
…alled from related print methods
65c9044
to
e5fccaa
Compare
edkrepo/common/ui_functions.py
Outdated
""" | ||
Displays informational message with (default) or without header. | ||
""" | ||
init_color_console("init") |
There was a problem hiding this comment.
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.
edkrepo/common/ui_functions.py
Outdated
""" | ||
Displays warning message with (default) or without header. | ||
""" | ||
init_color_console("init") |
There was a problem hiding this comment.
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.
edkrepo/common/ui_functions.py
Outdated
""" | ||
Displays error message with (default) or without header. | ||
""" | ||
init_color_console("init") |
There was a problem hiding this comment.
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.
The known message types are: Informational (Info), Warning and Error. With this change, methods for consistent console display is provided for those message types.