Skip to content

Commit 98f1f07

Browse files
committed
Fix: Typer namespace could be simplified
typer.style, typer.colors -> from typer import style, colors
1 parent b073576 commit 98f1f07

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/aleph_client/commands/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from pygments.formatters.terminal256 import Terminal256Formatter
2020
from pygments.lexers import JsonLexer
2121
from rich.prompt import IntPrompt, Prompt, PromptError
22-
from typer import echo
22+
from typer import colors, echo, style
2323

2424
from aleph_client.utils import fetch_json
2525

@@ -38,13 +38,13 @@ def colorful_json(obj: str):
3838
def colorized_status(status: MessageStatus) -> str:
3939
"""Return a colored status string based on its value."""
4040
status_colors = {
41-
MessageStatus.REJECTED: typer.colors.RED,
42-
MessageStatus.PROCESSED: typer.colors.GREEN,
43-
MessageStatus.PENDING: typer.colors.YELLOW,
44-
MessageStatus.FORGOTTEN: typer.colors.BRIGHT_BLACK,
41+
MessageStatus.REJECTED: colors.RED,
42+
MessageStatus.PROCESSED: colors.GREEN,
43+
MessageStatus.PENDING: colors.YELLOW,
44+
MessageStatus.FORGOTTEN: colors.BRIGHT_BLACK,
4545
}
46-
color = status_colors.get(status, typer.colors.WHITE)
47-
return typer.style(status, fg=color, bold=True)
46+
color = status_colors.get(status, colors.WHITE)
47+
return style(status, fg=color, bold=True)
4848

4949

5050
def colorful_message_json(message: GenericMessage):

0 commit comments

Comments
 (0)