mirror of
https://github.com/ikunshare/Onekey.git
synced 2026-01-12 16:25:53 +08:00
chore: 丝滑刷版本号测试
This commit is contained in:
18
main.py
18
main.py
@@ -1,8 +1,7 @@
|
||||
import os
|
||||
import time
|
||||
import sys
|
||||
import asyncio
|
||||
import re
|
||||
import platform
|
||||
|
||||
from colorama import Fore, Back, Style
|
||||
from colorama import init as cinit
|
||||
@@ -22,6 +21,20 @@ repos = [
|
||||
'tymolu233/ManifestAutoUpdate',
|
||||
]
|
||||
|
||||
def check_system_msg():
|
||||
os_type = platform.system()
|
||||
try:
|
||||
if not os_type == 'Windows':
|
||||
log.error(f'❌ 不用Windows你想上天?{os_type}')
|
||||
except Exception as e:
|
||||
log.error(f'❌ 获取系统类型失败:{stack_error(e)}')
|
||||
os_version = sys.getwindowsversion().major
|
||||
try:
|
||||
if os_version < 10:
|
||||
log.error(f'❌ 低于Windows10就别用了买台新电脑吧!当前版本:Windows {os_version}')
|
||||
except Exception as e:
|
||||
log.error(f'❌ 获取系统版本失败:{stack_error(e)}')
|
||||
|
||||
def prompt_app_id():
|
||||
app_id = input(f"{Fore.CYAN}{Back.BLACK}{Style.BRIGHT}🤔 请输入游戏AppID:{Style.RESET_ALL}").strip()
|
||||
if re.match(r'^\d+$', app_id):
|
||||
@@ -51,6 +64,7 @@ async def run():
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
check_system_msg()
|
||||
asyncio.run(run())
|
||||
except SystemExit:
|
||||
sys.exit()
|
||||
|
||||
Reference in New Issue
Block a user