forked from Election-Tech-Initiative/electionguard-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Migrate CLI print methods to single module
- Loading branch information
1 parent
35e900f
commit 08f673c
Showing
7 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import click | ||
from typing import Any | ||
|
||
def print_header(text: str, header_color="green"): | ||
def print_header_utils(text: str, header_color="green"): | ||
click.echo("") | ||
click.secho(f"{'-'*40}", fg=header_color) | ||
click.echo(text, fg=header_color) | ||
click.echo(f"{'-'*40}", header_color) | ||
|
||
def print_message(text: str, underlined=False): | ||
def print_message_utils(text: str, underlined=False): | ||
click.secho(f"{text}", fg="white", underline=underlined) | ||
|
||
def print_warning(text: str, warning_color="bright_red") -> None: | ||
def print_warning_utils(text: str, warning_color="bright_red") -> None: | ||
click.secho(f"WARNING: {text}", fg=warning_color, bold=True) | ||
|
||
def print_error(text: str, error_color="bright_red"): | ||
def print_error_utils(text: str, error_color="bright_red"): | ||
click.secho(f"Error: {text}", fg=error_color, bold=True, italic=True) | ||
|
||
def cleanup(): | ||
def print_value_utils(text: str, val: Any): | ||
click.echo(click.style(text + ": ") + click.style(val, fg="yellow")) | ||
|
||
def print_text_utils(text: Any): | ||
click.echo(text) | ||
|
||
def cleanup_utits(): | ||
click.clear() |