Add option to bypass token limit in menu

- Updated the menu in `main.py` to include a new option for bypassing token limits.
- Adjusted the choice number in the main loop to accommodate the new functionality.
- Integrated the `bypass_token_limit` script to be executed when the new menu option is selected.
This commit is contained in:
yeongpin 2025-04-11 10:54:29 +08:00
parent c7a84ca59f
commit c42d7d5422

View File

@ -288,7 +288,8 @@ def print_menu():
13: f"{Fore.GREEN}13{Style.RESET_ALL}. {EMOJI['SETTINGS']} {translator.get('menu.select_chrome_profile')}",
14: f"{Fore.GREEN}14{Style.RESET_ALL}. {EMOJI['ERROR']} {translator.get('menu.delete_google_account', fallback='Delete Cursor Google Account')}",
15: f"{Fore.GREEN}15{Style.RESET_ALL}. {EMOJI['UPDATE']} {translator.get('menu.bypass_version_check', fallback='Bypass Cursor Version Check')}",
16: f"{Fore.GREEN}16{Style.RESET_ALL}. {EMOJI['UPDATE']} {translator.get('menu.check_user_authorized', fallback='Check User Authorized')}"
16: f"{Fore.GREEN}16{Style.RESET_ALL}. {EMOJI['UPDATE']} {translator.get('menu.check_user_authorized', fallback='Check User Authorized')}",
17: f"{Fore.GREEN}17{Style.RESET_ALL}. {EMOJI['UPDATE']} {translator.get('menu.bypass_token_limit', fallback='Bypass Token Limit')}"
}
# Automatically calculate the number of menu items in the left and right columns
@ -561,7 +562,7 @@ def main():
while True:
try:
choice_num = 16
choice_num = 17
choice = input(f"\n{EMOJI['ARROW']} {Fore.CYAN}{translator.get('menu.input_choice', choices=f'0-{choice_num}')}: {Style.RESET_ALL}")
if choice == "0":
@ -635,6 +636,10 @@ def main():
import check_user_authorized
check_user_authorized.main(translator)
print_menu()
elif choice == "17":
import bypass_token_limit
bypass_token_limit.run(translator)
print_menu()
else:
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.invalid_choice')}{Style.RESET_ALL}")
print_menu()