@@ -379,8 +379,10 @@ def token_callback(access: str, refresh: str) -> None:
379379 print (f"Usage data from { start_date } to { end_date } " )
380380 print (f"Total records: { len (usage_data )} " )
381381 print ()
382- print (f"{ 'Timestamp' :<25} { 'Consumption' :>12} "
383- f"{ 'Generation' :>12} { 'Unit' :<6} " )
382+ print (
383+ f"{ 'Timestamp' :<25} { 'Consumption' :>12} "
384+ f"{ 'Generation' :>12} { 'Unit' :<6} "
385+ )
384386 print ("-" * 57 )
385387 for u in usage_data [:20 ]: # Show first 20
386388 print (
@@ -496,15 +498,15 @@ async def cmd_auth_helper(args: argparse.Namespace) -> int:
496498 print ("Enter your tokens below (paste and press Enter):" )
497499 print ()
498500
499- access_token = input ( "Access Token: " ).strip ()
501+ access_token = ( await asyncio . to_thread ( input , "Access Token: " ) ).strip ()
500502 if access_token .startswith ("Bearer " ):
501503 access_token = access_token [7 :]
502504
503505 if not access_token :
504506 print ("Error: Access token is required" , file = sys .stderr )
505507 return 1
506508
507- refresh_token = input ( "Refresh Token: " ).strip ()
509+ refresh_token = ( await asyncio . to_thread ( input , "Refresh Token: " ) ).strip ()
508510 if not refresh_token :
509511 print ("Error: Refresh token is required" , file = sys .stderr )
510512 return 1
@@ -560,7 +562,7 @@ async def cmd_login(args: argparse.Namespace) -> int:
560562 # Get credentials
561563 username = args .username
562564 if not username :
563- username = input ( "Email: " ).strip ()
565+ username = ( await asyncio . to_thread ( input , "Email: " ) ).strip ()
564566 if not username :
565567 print ("Error: Email is required" , file = sys .stderr )
566568 return 1
@@ -627,7 +629,8 @@ async def cmd_login(args: argparse.Namespace) -> int:
627629 # Get selection
628630 print ()
629631 while True :
630- selection = input (f"Enter choice (1-{ len (all_targets )} ): " ).strip ()
632+ prompt = f"Enter choice (1-{ len (all_targets )} ): "
633+ selection = (await asyncio .to_thread (input , prompt )).strip ()
631634 try :
632635 idx = int (selection ) - 1
633636 if 0 <= idx < len (all_targets ):
@@ -648,7 +651,7 @@ async def cmd_login(args: argparse.Namespace) -> int:
648651 print ("-" * 40 )
649652 print (f"Code sent to: { selected_target .obfuscated } " )
650653 print ("-" * 40 )
651- code = input ( "Enter code: " ).strip ()
654+ code = ( await asyncio . to_thread ( input , "Enter code: " ) ).strip ()
652655
653656 # Verify code
654657 print ("\n Verifying..." )
@@ -831,7 +834,8 @@ def token_callback(access: str, refresh: str) -> None:
831834
832835 print ()
833836 while True :
834- selection = input (f"Enter choice (1-{ len (accounts )} ): " ).strip ()
837+ prompt = f"Enter choice (1-{ len (accounts )} ): "
838+ selection = (await asyncio .to_thread (input , prompt )).strip ()
835839 try :
836840 idx = int (selection ) - 1
837841 if 0 <= idx < len (accounts ):
0 commit comments