Skip to content

Commit cac7205

Browse files
committed
Add spinner during provider initialization
1 parent b261b4d commit cac7205

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

stt.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,11 +1118,18 @@ def save_and_update(key, value):
11181118
# Check for updates in background
11191119
threading.Thread(target=check_for_updates, daemon=True).start()
11201120

1121-
# Initialize provider
1122-
try:
1123-
provider = get_provider(PROVIDER)
1124-
except ValueError as e:
1125-
console.print(f"[red]✗[/red] {e}")
1121+
# Initialize provider (may be slow due to imports)
1122+
from rich.status import Status
1123+
provider = None
1124+
init_error = None
1125+
with Status("[dim]Initializing...[/dim]", console=console, spinner="dots"):
1126+
try:
1127+
provider = get_provider(PROVIDER)
1128+
except ValueError as e:
1129+
init_error = e
1130+
1131+
if init_error:
1132+
console.print(f"[red]✗[/red] {init_error}")
11261133
sys.exit(1)
11271134

11281135
if not provider.is_available():

0 commit comments

Comments
 (0)