mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-03 04:57:36 +08:00
Merge branch 'main' of github.com:cjahv/cursor-free-vip
This commit is contained in:
commit
c3a3963a76
@ -26,7 +26,14 @@ EMOJI = {
|
|||||||
def get_user_documents_path():
|
def get_user_documents_path():
|
||||||
"""Get user Documents folder path"""
|
"""Get user Documents folder path"""
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
try:
|
||||||
|
import winreg
|
||||||
|
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders") as key:
|
||||||
|
documents_path, _ = winreg.QueryValueEx(key, "Personal")
|
||||||
|
return documents_path
|
||||||
|
except Exception as e:
|
||||||
|
# fallback
|
||||||
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
else: # Linux
|
else: # Linux
|
||||||
|
@ -116,7 +116,14 @@ def fill_signup_form(page, first_name, last_name, email, config, translator=None
|
|||||||
def get_user_documents_path():
|
def get_user_documents_path():
|
||||||
"""Get user Documents folder path"""
|
"""Get user Documents folder path"""
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
try:
|
||||||
|
import winreg
|
||||||
|
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders") as key:
|
||||||
|
documents_path, _ = winreg.QueryValueEx(key, "Personal")
|
||||||
|
return documents_path
|
||||||
|
except Exception as e:
|
||||||
|
# fallback
|
||||||
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
else: # Linux
|
else: # Linux
|
||||||
|
@ -33,7 +33,14 @@ EMOJI = {
|
|||||||
def get_user_documents_path():
|
def get_user_documents_path():
|
||||||
"""Get user Documents folder path"""
|
"""Get user Documents folder path"""
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
try:
|
||||||
|
import winreg
|
||||||
|
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders") as key:
|
||||||
|
documents_path, _ = winreg.QueryValueEx(key, "Personal")
|
||||||
|
return documents_path
|
||||||
|
except Exception as e:
|
||||||
|
# fallback
|
||||||
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
else: # Linux
|
else: # Linux
|
||||||
|
@ -32,7 +32,13 @@ EMOJI = {
|
|||||||
def get_user_documents_path():
|
def get_user_documents_path():
|
||||||
"""Get user Documents folder path"""
|
"""Get user Documents folder path"""
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
try:
|
||||||
|
import winreg
|
||||||
|
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders") as key:
|
||||||
|
documents_path, _ = winreg.QueryValueEx(key, "Personal")
|
||||||
|
return documents_path
|
||||||
|
except Exception as e:
|
||||||
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
return os.path.join(os.path.expanduser("~"), "Documents")
|
return os.path.join(os.path.expanduser("~"), "Documents")
|
||||||
else: # Linux
|
else: # Linux
|
||||||
|
11
utils.py
11
utils.py
@ -6,7 +6,16 @@ import random
|
|||||||
def get_user_documents_path():
|
def get_user_documents_path():
|
||||||
"""Get user documents path"""
|
"""Get user documents path"""
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
return os.path.expanduser("~\\Documents")
|
try:
|
||||||
|
import winreg
|
||||||
|
# 打开注册表
|
||||||
|
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders") as key:
|
||||||
|
# 获取 "Personal" 键的值,这指向用户的文档目录
|
||||||
|
documents_path, _ = winreg.QueryValueEx(key, "Personal")
|
||||||
|
return documents_path
|
||||||
|
except Exception as e:
|
||||||
|
# fallback
|
||||||
|
return os.path.expanduser("~\\Documents")
|
||||||
else:
|
else:
|
||||||
return os.path.expanduser("~/Documents")
|
return os.path.expanduser("~/Documents")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user