19
19
from pygments .formatters .terminal256 import Terminal256Formatter
20
20
from pygments .lexers import JsonLexer
21
21
from rich .prompt import IntPrompt , Prompt , PromptError
22
- from typer import echo
22
+ from typer import colors , echo , style
23
23
24
24
from aleph_client .utils import fetch_json
25
25
@@ -38,13 +38,13 @@ def colorful_json(obj: str):
38
38
def colorized_status (status : MessageStatus ) -> str :
39
39
"""Return a colored status string based on its value."""
40
40
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 ,
45
45
}
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 )
48
48
49
49
50
50
def colorful_message_json (message : GenericMessage ):
0 commit comments