-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathprint_utils.py
More file actions
29 lines (21 loc) · 1.03 KB
/
print_utils.py
File metadata and controls
29 lines (21 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import click
from typing import Any, Optional
VERIFICATION_URL_NAME = "verification_url"
def print_header(text: str, header_color="green") -> None:
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, 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:
click.secho(f"WARNING: {text}", fg=warning_color, bold=True)
def print_error(text: str, error_color="bright_red"):
click.secho(f"Error: {text}", fg=error_color, bold=True, italic=True)
def print_value(name: str, value: Any, value_color="yellow") -> None:
click.echo(click.style(name + ": ") + click.style(value, fg=self.value_color))
def print_section(text: Optional[str], section_color="bright-white") -> None:
click.echo("")
click.secho(text, fg=section_color, bold=True)
def cleanup() -> None:
click.clear()