#601 Creation of print_utils.py#716
#601 Creation of print_utils.py#716JKnight777 wants to merge 7 commits intoElection-Tech-Initiative:mainfrom
Conversation
Co-authored-by: Pedro Rangel <CodingForFun-coder@users.noreply.github.com>
Added a new python file called print_utils.py to replace cli_step_base.py and all of the click imports in other files.
Changed the implementation of click in all electionguard_cli files that import click and only use echo/secho, to a new file called print_utils.py. print_utils.py has functions print_message, print_header, print_error, and print_warning that utilizes click.secho and click.echo to replace the click.echo and click.secho functions in other files.
….com> Co-authored-by: Antonio Lopez Jr <Alopezjr2002@users.noreply.github.com>
|
This pull request introduces 10 alerts when merging 45a01f8 into 670b007 - view on LGTM.com new alerts:
|
Finished print_utils.py, and updated cli_step_base.py to incorporate it.
|
This pull request introduces 9 alerts when merging 9ed7a11 into 670b007 - view on LGTM.com new alerts:
|
|
@JKnight777 Thanks for the submission. The first things that you need to do is to please sign the CLA. |
| @@ -1,5 +1,5 @@ | |||
| from typing import Any, Optional | |||
| import click | |||
| import print_utils | |||
There was a problem hiding this comment.
You can remove the header_color and other colors that are unused in this file
| @@ -1,5 +1,5 @@ | |||
| from typing import List | |||
| import click | |||
| #import click | |||
There was a problem hiding this comment.
For a polished PR, delete commented out code
|
|
||
|
|
||
| class InputRetrievalStepBase(CliStepBase): | ||
| class InputRetrievalStepBase("""CliStepBase"""): |
There was a problem hiding this comment.
I'd like to understand why clickstepbase has triple quotes here...
| def print_message(text: str, color="white", underlined=False, bolded=False) -> None: | ||
| click.secho(f"{text}", fg=color, underline=underlined, bold=bolded) | ||
|
|
||
| def print_warning(text: str, warning_color="bright_red") -> None: |
There was a problem hiding this comment.
can you confirm that the warning color and error color are the same?
|
This pull request introduces 1 alert when merging bf7d69f into 46dbc34 - view on LGTM.com new alerts:
|
shivbijlani
left a comment
There was a problem hiding this comment.
Looks good to me. Please add proof that it still works with screenshots, or describe your testing.
|
This pull request introduces 1 alert when merging df050d7 into 0dabe5e - view on LGTM.com new alerts:
|
Issue 601
Fixes #601
Description
Created a new file called print_utils.py that will help reduce the amount of click.echos in electionguard_cli, while also providing more useful functions that can potentially replace cli_base_step, such as print_header, print_error, print_warning, and print_message.