File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,12 @@ def daily(
2525 result = get_daily_question ()
2626 question = result ['data' ]['activeDailyCodingChallengeQuestion' ]
2727 typer .echo ("\r " + " " * 30 + "\r " , nl = False )
28+
29+ show (problem = question ['question' ]['titleSlug' ], save = save )
2830 except Exception as e :
2931 typer .echo ("\n " + typer .style (f"❌ Failed to fetch daily question: { str (e )} " , fg = typer .colors .RED ))
3032 raise typer .Exit (1 )
3133
32- show (problem = question ['question' ]['titleSlug' ], save = save )
3334
3435 if not no_editor and editor :
3536 try :
Original file line number Diff line number Diff line change 44from typing import Optional
55from ..lib .ui import display_problem_list
66from ..server .auth import Auth
7+ from rich .progress import Progress , SpinnerColumn , TextColumn
78
89import typer
910
@@ -31,8 +32,12 @@ def list_problems(
3132
3233 tags = tag .split (',' ) if tag else []
3334
34- with Live (Spinner ('dots' ), refresh_per_second = 10 ) as live :
35- live .console .print ("[cyan]Fetching problems..." )
35+ with Progress (
36+ SpinnerColumn (),
37+ TextColumn ("[progress.description]{task.description}" ),
38+ transient = True ,
39+ ) as progress :
40+ progress .add_task ("Fetching problems..." , total = 1 )
3641
3742 session = AuthManager .session_manager .load_session ()
3843 if not session :
Original file line number Diff line number Diff line change 33from ..lib .problem_ui import ProblemDetails
44from ..server .auth import Auth
55from ..server .solution_manager import SolutionManager
6+ from rich .progress import Progress , SpinnerColumn , TextColumn
67
78auth_manager = Auth ()
89solution_manager = SolutionManager (auth_manager .get_session ())
@@ -24,7 +25,14 @@ def show(
2425 raise typer .Exit (1 )
2526
2627 try :
27- data = solution_manager .get_question_data (problem )
28+ with Progress (
29+ SpinnerColumn (),
30+ TextColumn ("[progress.description]{task.description}" ),
31+ transient = True
32+ ) as progress :
33+ progress .add_task ("Fetching problem data..." , total = 1 )
34+ data = solution_manager .get_question_data (problem )
35+
2836 if not data .get ('data' , {}).get ('question' ):
2937 typer .echo (typer .style (f"❌ Problem '{ problem } ' not found" , fg = typer .colors .RED ))
3038 raise typer .Exit (1 )
You can’t perform that action at this time.
0 commit comments