mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-10-21 16:10:06 +08:00
feat: Refactor Project Structure and Add Configuration Management
- Add `config.py` for centralized configuration management - Add `utils.py` for cross-platform utility functions - Remove `browser.py` and `control.py` to simplify project structure - Update version to 1.7.06 - Modify build specification to reflect new file structure - Update localization files with new update confirmation messages - Enhance configuration loading and path detection across different platforms
This commit is contained in:
15
main.py
15
main.py
@@ -9,6 +9,7 @@ import locale
|
||||
import platform
|
||||
import requests
|
||||
import subprocess
|
||||
from config import get_config
|
||||
|
||||
# 只在 Windows 系统上导入 windll
|
||||
if platform.system() == 'Windows':
|
||||
@@ -238,6 +239,17 @@ def check_latest_version():
|
||||
if latest_version != version:
|
||||
print(f"\n{Fore.YELLOW}{EMOJI['INFO']} {translator.get('updater.new_version_available', current=version, latest=latest_version)}{Style.RESET_ALL}")
|
||||
|
||||
# 詢問用戶是否要更新
|
||||
while True:
|
||||
choice = input(f"\n{EMOJI['ARROW']} {Fore.CYAN}{translator.get('updater.update_confirm', choices='Y/n')}: {Style.RESET_ALL}").lower()
|
||||
if choice in ['', 'y', 'yes']:
|
||||
break
|
||||
elif choice in ['n', 'no']:
|
||||
print(f"\n{Fore.YELLOW}{EMOJI['INFO']} {translator.get('updater.update_skipped')}{Style.RESET_ALL}")
|
||||
return
|
||||
else:
|
||||
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.invalid_choice')}{Style.RESET_ALL}")
|
||||
|
||||
try:
|
||||
# Execute update command based on platform
|
||||
if platform.system() == 'Windows':
|
||||
@@ -287,8 +299,7 @@ def main():
|
||||
print_logo()
|
||||
|
||||
# 初始化配置
|
||||
from new_signup import setup_config
|
||||
config = setup_config(translator)
|
||||
config = get_config(translator)
|
||||
if not config:
|
||||
print(f"{Fore.RED}{EMOJI['ERROR']} {translator.get('menu.config_init_failed')}{Style.RESET_ALL}")
|
||||
return
|
||||
|
Reference in New Issue
Block a user