chore:改点东西

This commit is contained in:
WangXianming
2024-10-12 20:06:27 +08:00
parent 3fa925c161
commit 600a8679f3
7 changed files with 36 additions and 50 deletions

28
main.py
View File

@@ -25,26 +25,28 @@ def check_system_msg():
os_type = platform.system()
try:
if os_type != 'Windows':
log.error(f'用Windows你想上天?{os_type}')
sys.quit()
log.error(f'请使用Windows系统!当前系统:{os_type}')
sys.exit()
except Exception as e:
log.error(f'❌ 获取系统类型失败{stack_error(e)}')
sys.quit()
os_version = sys.getwindowsversion().major
log.error(f'❌ 获取系统类型失败:{stack_error(e)}')
sys.exit()
try:
if os_version < 10:
log.error(f'❌ 低于Windows10就别用了买台新电脑吧当前版本Windows {os_version}')
sys.quit()
os_version = platform.version().split('.')[0]
if int(os_version) < 10:
log.error(f'❌ 请使用Windows 10或更高版本!当前版本:Windows {os_version}')
sys.exit()
except Exception as e:
log.error(f'❌ 获取系统版本失败:{stack_error(e)}')
sys.quit()
sys.exit()
def prompt_app_id():
app_id = input(f"{Fore.CYAN}{Back.BLACK}{Style.BRIGHT}🤔 请输入游戏AppID{Style.RESET_ALL}").strip()
while True:
app_id = input(f"{Fore.CYAN}{Back.BLACK}{Style.BRIGHT}🤔 请输入游戏AppID:{Style.RESET_ALL}").strip()
if re.match(r'^\d+$', app_id):
return app_id
else:
print(f"{Fore.RED}⚠ 无效的AppID请输入数字{Style.RESET_ALL}")
print(f"{Fore.RED}⚠ 无效的AppID,请输入数字!{Style.RESET_ALL}")
async def main_loop():
while True:
@@ -61,10 +63,8 @@ async def run():
except KeyboardInterrupt:
log.info("👋 程序已退出")
except Exception as e:
log.error(f' ⚠ 发生错误: {stack_error(e)}将在5秒后退出')
log.error(f' ⚠ 发生错误: {stack_error(e)},将在5秒后退出')
await asyncio.sleep(5)
finally:
asyncio.get_event_loop().stop()
if __name__ == '__main__':
try: