File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from urllib .parse import urlparse
55
66import async_typer as typer
7+ from rich .console import Console
78
89from app import client
910from app .builder .urls import UrlBuilder
1011from app .helpers .archive import decompress
1112from app .helpers .crypto import base64url_to_ikm , decrypt
1213
1314app = typer .AsyncTyper (help = "Download encrypted files via Chithi." )
15+ console : Console = Console ()
16+ error_console : Console = Console (stderr = True )
1417
1518
1619@app .async_command ()
@@ -62,8 +65,8 @@ async def download(
6265 out_path = output .resolve ()
6366 decompress (tmp_zip , out_path , password = password )
6467
65- typer . secho (f"\n ✓ Success! Extracted to { out_path } " , fg = typer . colors . GREEN )
68+ console . print (f"\n [green] ✓ Success! Extracted to { out_path } [/green]" )
6669
6770 except Exception as exc :
68- typer . secho (f"✗ Download failed: { exc } " , fg = typer . colors . RED , err = True )
71+ error_console . print (f"[red] ✗ Download failed: { exc } [/red]" )
6972 raise typer .Exit (1 )
Original file line number Diff line number Diff line change 1414from app .helpers .print import print_compact_qr
1515
1616app = typer .AsyncTyper (help = "Upload encrypted files via Chithi." )
17- console : Console = Console ()
17+ console = Console ()
1818
1919
2020@app .async_command ()
You can’t perform that action at this time.
0 commit comments