fix(flash-gui): 窗口构建期隐藏改为延迟显示, 修复双击'闪退'; 打包改 onedir 提速

This commit is contained in:
2026-09-14 20:19:01 +08:00
parent 337e53d099
commit 9a5d00ecf5
7 changed files with 108 additions and 61 deletions
+16 -2
View File
@@ -33,6 +33,7 @@ import argparse
import os
import subprocess
import sys
import time
import config
import openocd_runner
@@ -194,8 +195,21 @@ def main():
sys.exit(run_openocd(args, '复位芯片', openocd_runner.script_reset()))
# 无操作参数 → 启动 GUI(实现在 app_gui.py)
import app_gui
app_gui.run_gui(args.seconds)
try:
import app_gui
app_gui.run_gui(args.seconds)
except SystemExit:
raise
except Exception:
# --noconsole 打包后异常无处可见, 落一份 crash.log 到程序目录便于远程定位
import traceback
try:
with open(os.path.join(config.BASE_DIR, 'crash.log'), 'w',
encoding='utf-8') as f:
f.write(time.strftime('%Y-%m-%d %H:%M:%S\n') + traceback.format_exc())
except OSError:
pass
raise
if __name__ == '__main__':