mirror of
https://git.axenov.dev/mirrors/cursor-free-vip.git
synced 2025-12-27 06:00:38 +03: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:
32
utils.py
Normal file
32
utils.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
def get_user_documents_path():
|
||||
"""Get user documents path"""
|
||||
if platform.system() == "Windows":
|
||||
return os.path.expanduser("~\\Documents")
|
||||
else:
|
||||
return os.path.expanduser("~/Documents")
|
||||
|
||||
def get_default_chrome_path():
|
||||
"""Get default Chrome path"""
|
||||
if sys.platform == "win32":
|
||||
return r"C:\Program Files\Google\Chrome\Application\chrome.exe"
|
||||
elif sys.platform == "darwin":
|
||||
return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
||||
else:
|
||||
return "/usr/bin/google-chrome"
|
||||
|
||||
def get_linux_cursor_path():
|
||||
"""Get Linux Cursor path"""
|
||||
possible_paths = [
|
||||
"/opt/Cursor/resources/app",
|
||||
"/usr/share/cursor/resources/app",
|
||||
"/opt/cursor-bin/resources/app",
|
||||
"/usr/lib/cursor/resources/app",
|
||||
os.path.expanduser("~/.local/share/cursor/resources/app")
|
||||
]
|
||||
|
||||
# 返回第一个存在的路径,如果都不存在则返回第一个路径
|
||||
return next((path for path in possible_paths if os.path.exists(path)), possible_paths[0])
|
||||
Reference in New Issue
Block a user