feat: 娣诲姞30鍒嗛挓瓒呮椂淇濇姢鍜屾墜鍔ㄥ彂閫佽繑鍥為敭鍔熻兘
This commit is contained in:
1 parent
fe0098c591
commit
97bda4816f
25 files changed
+22400
-23900
No files matched your search
+370
-80
@@ -1576,7 +1576,7 @@ def main():
|
||||
status_var.set("已停止")
|
||||
|
||||
# 先打包 actions 到底部(不 expand,固定在底部)
|
||||
actions.pack(fill=X, pady=(10, 0), padx=12)
|
||||
actions.pack(fill=X, pady=(10, 0), padx=12, side="bottom")
|
||||
|
||||
# 然后打包 notebook 填充剩余空间(在 actions 之上)
|
||||
notebook.pack(fill=BOTH, expand=True)
|
||||
@@ -1642,6 +1642,18 @@ def main():
|
||||
on_line(f"[错误] {e}")
|
||||
|
||||
ttk.Button(actions, text="测试评论", command=start_test_comment).pack(side=LEFT)
|
||||
|
||||
ttk.Separator(actions, orient="vertical").pack(side=LEFT, fill=Y, padx=10, pady=3)
|
||||
|
||||
def send_back_key():
|
||||
dev = device_var.get().strip()
|
||||
try:
|
||||
runner.send_back_key(dev)
|
||||
except Exception as e:
|
||||
on_line(f"[错误] 发送返回键失败: {e}")
|
||||
|
||||
ttk.Button(actions, text="发送返回键", command=send_back_key).pack(side=LEFT, padx=(0, 8))
|
||||
|
||||
ttk.Label(actions, textvariable=status_var).pack(side=RIGHT)
|
||||
|
||||
def pump_logs():
|
||||
@@ -1703,34 +1715,90 @@ def main():
|
||||
exit_code = stats.get("exit_code")
|
||||
lines.append(f"退出码: {exit_code if exit_code is not None else '-'}")
|
||||
lines.append("")
|
||||
|
||||
|
||||
# 计数器统计
|
||||
counters = stats.get("counters", {})
|
||||
if counters:
|
||||
|
||||
# 快速汇总(关键指标)
|
||||
fudai_seen = counters.get("fudai_seen", 0)
|
||||
fudai_attend_ok = counters.get("fudai_attend_ok", 0)
|
||||
fudai_result_win = counters.get("fudai_result_win", 0)
|
||||
fudai_order_success = counters.get("fudai_order_success", 0)
|
||||
|
||||
if fudai_seen > 0 or fudai_attend_ok > 0 or fudai_result_win > 0:
|
||||
lines.append("=" * 60)
|
||||
lines.append("计数器统计")
|
||||
lines.append("快速汇总")
|
||||
lines.append("=" * 60)
|
||||
|
||||
# 福袋相关
|
||||
fudai_stats = [
|
||||
("fudai_seen", "福袋识别次数"),
|
||||
("fudai_open_detail", "打开详情"),
|
||||
("fudai_click_attend", "点击参与"),
|
||||
("fudai_attend_ok", "参与成功/已参与"),
|
||||
("fudai_attend_fail", "参与失败"),
|
||||
("fudai_result_win", "中奖"),
|
||||
("fudai_result_no_win", "未中奖"),
|
||||
("fudai_order_success", "下单成功"),
|
||||
]
|
||||
for key, label in fudai_stats:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
lines.append(f" {label}: {val}")
|
||||
|
||||
lines.append(f"识别福袋: {fudai_seen} 个")
|
||||
lines.append(f"参与成功: {fudai_attend_ok} 次")
|
||||
lines.append(f"中奖次数: {fudai_result_win} 次")
|
||||
lines.append(f"下单成功: {fudai_order_success} 次")
|
||||
if uptime_seconds > 0:
|
||||
hours = uptime_seconds / 3600.0
|
||||
if hours > 0:
|
||||
lines.append(f"运行效率: {fudai_attend_ok / hours:.1f} 次参与/小时")
|
||||
lines.append("")
|
||||
|
||||
# 跳过原因
|
||||
skip_stats = [
|
||||
# 核心统计(总是显示,即使数据为0)
|
||||
lines.append("=" * 60)
|
||||
lines.append("核心统计")
|
||||
lines.append("=" * 60)
|
||||
|
||||
# 福袋相关核心指标(重新获取,避免重复定义)
|
||||
fudai_open_detail = counters.get("fudai_open_detail", 0)
|
||||
fudai_click_attend = counters.get("fudai_click_attend", 0)
|
||||
fudai_attend_ok = counters.get("fudai_attend_ok", 0)
|
||||
fudai_attend_fail = counters.get("fudai_attend_fail", 0)
|
||||
fudai_result_win = counters.get("fudai_result_win", 0)
|
||||
fudai_result_no_win = counters.get("fudai_result_no_win", 0)
|
||||
fudai_order_success = counters.get("fudai_order_success", 0)
|
||||
|
||||
lines.append(f"福袋识别次数: {fudai_seen}")
|
||||
lines.append(f"打开详情: {fudai_open_detail}")
|
||||
if fudai_seen > 0:
|
||||
open_rate = (fudai_open_detail / fudai_seen) * 100
|
||||
lines.append(f" 打开成功率: {open_rate:.1f}%")
|
||||
|
||||
lines.append(f"点击参与: {fudai_click_attend}")
|
||||
if fudai_open_detail > 0:
|
||||
click_rate = (fudai_click_attend / fudai_open_detail) * 100
|
||||
lines.append(f" 点击率: {click_rate:.1f}%")
|
||||
|
||||
lines.append(f"参与成功: {fudai_attend_ok}")
|
||||
lines.append(f"参与失败: {fudai_attend_fail}")
|
||||
total_attend = fudai_attend_ok + fudai_attend_fail
|
||||
if total_attend > 0:
|
||||
success_rate = (fudai_attend_ok / total_attend) * 100
|
||||
lines.append(f" 参与成功率: {success_rate:.1f}%")
|
||||
|
||||
lines.append(f"中奖次数: {fudai_result_win}")
|
||||
lines.append(f"未中奖次数: {fudai_result_no_win}")
|
||||
total_results = fudai_result_win + fudai_result_no_win
|
||||
if total_results > 0:
|
||||
win_rate = (fudai_result_win / total_results) * 100
|
||||
lines.append(f" 中奖率: {win_rate:.1f}%")
|
||||
|
||||
lines.append(f"下单成功: {fudai_order_success}")
|
||||
|
||||
# 效率统计
|
||||
if uptime_seconds > 0:
|
||||
hours = uptime_seconds / 3600.0
|
||||
if hours > 0:
|
||||
lines.append("")
|
||||
lines.append("效率统计(每小时):")
|
||||
if fudai_seen > 0:
|
||||
lines.append(f" 识别福袋: {fudai_seen / hours:.1f} 个/小时")
|
||||
if fudai_attend_ok > 0:
|
||||
lines.append(f" 参与成功: {fudai_attend_ok / hours:.1f} 次/小时")
|
||||
if total_results > 0:
|
||||
lines.append(f" 开奖次数: {total_results / hours:.1f} 次/小时")
|
||||
if fudai_result_win > 0:
|
||||
lines.append(f" 中奖次数: {fudai_result_win / hours:.2f} 次/小时")
|
||||
|
||||
lines.append("")
|
||||
|
||||
# 跳过原因统计
|
||||
skip_stats = [
|
||||
("fudai_skip_value_low", "跳过-价值过低"),
|
||||
("fudai_skip_participants_low", "跳过-人数过少"),
|
||||
("fudai_skip_participants_high", "跳过-人数过多"),
|
||||
@@ -1738,76 +1806,145 @@ def main():
|
||||
("fudai_skip_countdown_short", "跳过-倒计时太短"),
|
||||
("fudai_skip_countdown_long", "跳过-倒计时太长"),
|
||||
("fudai_skip_watch_required", "跳过-需要看播"),
|
||||
]
|
||||
skip_found = False
|
||||
]
|
||||
skip_total = sum(counters.get(key, 0) for key, _ in skip_stats)
|
||||
if skip_total > 0:
|
||||
lines.append("=" * 60)
|
||||
lines.append("跳过原因统计")
|
||||
lines.append("=" * 60)
|
||||
lines.append(f"总跳过次数: {skip_total}")
|
||||
if fudai_seen > 0:
|
||||
skip_rate = (skip_total / fudai_seen) * 100
|
||||
lines.append(f"跳过率: {skip_rate:.1f}%")
|
||||
lines.append("")
|
||||
for key, label in skip_stats:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
if not skip_found:
|
||||
lines.append("跳过原因统计:")
|
||||
skip_found = True
|
||||
lines.append(f" {label}: {val}")
|
||||
percentage = (val / skip_total) * 100 if skip_total > 0 else 0
|
||||
lines.append(f" {label}: {val} ({percentage:.1f}%)")
|
||||
lines.append("")
|
||||
|
||||
if skip_found:
|
||||
lines.append("")
|
||||
|
||||
# 粉丝团
|
||||
fansclub_stats = [
|
||||
("fansclub_required", "需要粉丝团"),
|
||||
("fansclub_manual_needed", "需手动加入"),
|
||||
("fansclub_unresolved", "未解决"),
|
||||
]
|
||||
fansclub_found = False
|
||||
# 粉丝团统计
|
||||
fansclub_stats = [
|
||||
("fansclub_required", "需要粉丝团"),
|
||||
("fansclub_manual_needed", "需手动加入"),
|
||||
("fansclub_unresolved", "未解决"),
|
||||
]
|
||||
fansclub_total = sum(counters.get(key, 0) for key, _ in fansclub_stats)
|
||||
if fansclub_total > 0:
|
||||
lines.append("=" * 60)
|
||||
lines.append("粉丝团相关统计")
|
||||
lines.append("=" * 60)
|
||||
for key, label in fansclub_stats:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
if not fansclub_found:
|
||||
lines.append("粉丝团相关:")
|
||||
fansclub_found = True
|
||||
lines.append(f" {label}: {val}")
|
||||
percentage = (val / fansclub_total) * 100 if fansclub_total > 0 else 0
|
||||
lines.append(f" {label}: {val} ({percentage:.1f}%)")
|
||||
lines.append("")
|
||||
|
||||
if fansclub_found:
|
||||
lines.append("")
|
||||
|
||||
# 直播间切换
|
||||
switch_val = counters.get("switch_room", 0)
|
||||
if switch_val > 0:
|
||||
lines.append(f"切换直播间: {switch_val}")
|
||||
switch_reasons = [
|
||||
("switch_room_no_fudai", "无福袋"),
|
||||
("switch_room_participants", "人数不符合"),
|
||||
("switch_room_value", "价值不符合"),
|
||||
("switch_room_content", "内容不符合"),
|
||||
("switch_room_countdown", "倒计时不符合"),
|
||||
("switch_room_attend_fail", "参与失败"),
|
||||
]
|
||||
reason_lines = []
|
||||
for key, label in switch_reasons:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
reason_lines.append(f"{label}:{val}")
|
||||
if reason_lines:
|
||||
lines.append(f" 原因: {' / '.join(reason_lines)}")
|
||||
lines.append("")
|
||||
|
||||
# 预约相关
|
||||
reservation_stats = [
|
||||
("reservation_back_verify_ok", "预约回退校验成功"),
|
||||
("reservation_back_verify_fail", "预约回退校验失败"),
|
||||
("reservation_drop_low_value", "预约丢弃低价值"),
|
||||
("reservation_clear", "清空预约队列"),
|
||||
# 直播间切换统计
|
||||
switch_val = counters.get("switch_room", 0)
|
||||
if switch_val > 0:
|
||||
lines.append("=" * 60)
|
||||
lines.append("直播间切换统计")
|
||||
lines.append("=" * 60)
|
||||
lines.append(f"总切换次数: {switch_val}")
|
||||
if uptime_seconds > 0:
|
||||
hours = uptime_seconds / 3600.0
|
||||
if hours > 0:
|
||||
lines.append(f"切换频率: {switch_val / hours:.1f} 次/小时")
|
||||
lines.append("")
|
||||
switch_reasons = [
|
||||
("switch_room_no_fudai", "无福袋"),
|
||||
("switch_room_participants", "人数不符合"),
|
||||
("switch_room_value", "价值不符合"),
|
||||
("switch_room_content", "内容不符合"),
|
||||
("switch_room_countdown", "倒计时不符合"),
|
||||
("switch_room_attend_fail", "参与失败"),
|
||||
]
|
||||
reservation_found = False
|
||||
for key, label in switch_reasons:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
percentage = (val / switch_val) * 100 if switch_val > 0 else 0
|
||||
lines.append(f" {label}: {val} ({percentage:.1f}%)")
|
||||
lines.append("")
|
||||
|
||||
# 预约相关统计
|
||||
reservation_stats = [
|
||||
("reservation_back_verify_ok", "预约回退校验成功"),
|
||||
("reservation_back_verify_fail", "预约回退校验失败"),
|
||||
("reservation_drop_low_value", "预约丢弃低价值"),
|
||||
("reservation_clear", "清空预约队列"),
|
||||
]
|
||||
reservation_total = sum(counters.get(key, 0) for key, _ in reservation_stats)
|
||||
if reservation_total > 0:
|
||||
lines.append("=" * 60)
|
||||
lines.append("预约相关统计")
|
||||
lines.append("=" * 60)
|
||||
verify_ok = counters.get("reservation_back_verify_ok", 0)
|
||||
verify_fail = counters.get("reservation_back_verify_fail", 0)
|
||||
verify_total = verify_ok + verify_fail
|
||||
if verify_total > 0:
|
||||
verify_rate = (verify_ok / verify_total) * 100
|
||||
lines.append(f"回退校验成功率: {verify_rate:.1f}% ({verify_ok}/{verify_total})")
|
||||
lines.append("")
|
||||
for key, label in reservation_stats:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
if not reservation_found:
|
||||
lines.append("预约相关:")
|
||||
reservation_found = True
|
||||
lines.append(f" {label}: {val}")
|
||||
lines.append("")
|
||||
|
||||
# 错误统计
|
||||
error_stats = [
|
||||
("fudai_open_error", "打开福袋异常"),
|
||||
("fudai_open_error_too_many", "打开失败次数过多"),
|
||||
]
|
||||
error_total = sum(counters.get(key, 0) for key, _ in error_stats)
|
||||
if error_total > 0:
|
||||
lines.append("=" * 60)
|
||||
lines.append("错误统计")
|
||||
lines.append("=" * 60)
|
||||
for key, label in error_stats:
|
||||
val = counters.get(key, 0)
|
||||
if val > 0:
|
||||
lines.append(f" {label}: {val}")
|
||||
lines.append("")
|
||||
|
||||
if reservation_found:
|
||||
lines.append("")
|
||||
# 价值统计(从事件中提取)
|
||||
events = stats.get("events", [])
|
||||
prize_values = []
|
||||
for event in events:
|
||||
meta = event.get("meta", {})
|
||||
if "prize_value_yuan" in meta and meta["prize_value_yuan"] is not None:
|
||||
try:
|
||||
prize_values.append(float(meta["prize_value_yuan"]))
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
|
||||
if prize_values:
|
||||
lines.append("=" * 60)
|
||||
lines.append("价值统计")
|
||||
lines.append("=" * 60)
|
||||
total_value = sum(prize_values)
|
||||
avg_value = total_value / len(prize_values)
|
||||
max_value = max(prize_values)
|
||||
min_value = min(prize_values)
|
||||
lines.append(f"识别到的福袋总数: {len(prize_values)}")
|
||||
lines.append(f"总价值: {total_value:.2f} 元")
|
||||
lines.append(f"平均价值: {avg_value:.2f} 元")
|
||||
lines.append(f"最高价值: {max_value:.2f} 元")
|
||||
lines.append(f"最低价值: {min_value:.2f} 元")
|
||||
|
||||
# 价值分布
|
||||
high_value_count = sum(1 for v in prize_values if v >= 500)
|
||||
medium_value_count = sum(1 for v in prize_values if 100 <= v < 500)
|
||||
low_value_count = sum(1 for v in prize_values if v < 100)
|
||||
lines.append("")
|
||||
lines.append("价值分布:")
|
||||
lines.append(f" 高价值(≥500元): {high_value_count} ({high_value_count/len(prize_values)*100:.1f}%)")
|
||||
lines.append(f" 中价值(100-500元): {medium_value_count} ({medium_value_count/len(prize_values)*100:.1f}%)")
|
||||
lines.append(f" 低价值(<100元): {low_value_count} ({low_value_count/len(prize_values)*100:.1f}%)")
|
||||
lines.append("")
|
||||
|
||||
# 最近一次福袋信息
|
||||
fudai_last = stats.get("fudai_last", {})
|
||||
@@ -1821,6 +1958,9 @@ def main():
|
||||
copies = fudai_last.get("copies")
|
||||
if participants is not None and copies is not None:
|
||||
lines.append(f"参与人数/份数: {participants} / {copies}")
|
||||
if participants > 0 and copies > 0:
|
||||
ratio = participants / copies
|
||||
lines.append(f" 中奖概率: {1/ratio*100:.2f}% (1/{ratio:.1f})")
|
||||
prize_value = fudai_last.get("prize_value_yuan")
|
||||
if prize_value is not None:
|
||||
lines.append(f"奖品价值: {prize_value} 元")
|
||||
@@ -1859,11 +1999,22 @@ def main():
|
||||
f" 人数/份数: {win.get('participants')} / {win.get('copies')}"
|
||||
)
|
||||
|
||||
# 确保至少显示基本信息
|
||||
if not lines:
|
||||
lines.append("=" * 60)
|
||||
lines.append("统计信息")
|
||||
lines.append("=" * 60)
|
||||
lines.append("暂无统计数据")
|
||||
lines.append("")
|
||||
lines.append("提示:请先运行程序以收集统计数据")
|
||||
|
||||
stats_text.delete("1.0", "end")
|
||||
stats_text.insert("1.0", "\n".join(lines))
|
||||
except Exception as e:
|
||||
import traceback
|
||||
stats_text.delete("1.0", "end")
|
||||
stats_text.insert("1.0", f"刷新统计信息失败:{e}")
|
||||
error_detail = traceback.format_exc()
|
||||
stats_text.insert("1.0", f"刷新统计信息失败:{e}\n\n详细信息:\n{error_detail}")
|
||||
|
||||
ttk.Button(stats_top, text="刷新", command=refresh_stats).pack(side=LEFT)
|
||||
|
||||
@@ -2060,6 +2211,145 @@ def main():
|
||||
root.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
from version import print_version_banner
|
||||
|
||||
print_version_banner("gui_app")
|
||||
except Exception:
|
||||
pass
|
||||
main()
|
||||
|
||||
actions_log_top = ttk.Frame(actions_log_tab)
|
||||
actions_log_top.pack(fill=X, padx=10, pady=(10, 0))
|
||||
actions_log_text = ScrolledText(actions_log_tab)
|
||||
actions_log_text.pack(fill=BOTH, expand=True, padx=10, pady=10)
|
||||
try:
|
||||
actions_log_text.configure(font=("Consolas", 10))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
actions_filter_var = tk.StringVar(value="")
|
||||
|
||||
def refresh_actions_log():
|
||||
"""读取 logs/actions.log 的尾部若干行,在 GUI 中展示关键行为日志(支持简单关键字筛选)。"""
|
||||
path = os.path.join(os.path.dirname(__file__), "logs", "actions.log")
|
||||
try:
|
||||
if os.path.exists(path):
|
||||
# 仿照 web_gui 的实现:只读最后一小段,避免文件巨大
|
||||
size = os.path.getsize(path)
|
||||
read_bytes = min(size, 65536)
|
||||
with open(path, "rb") as f:
|
||||
if read_bytes < size:
|
||||
f.seek(-read_bytes, os.SEEK_END)
|
||||
data = f.read().decode("utf-8", errors="replace")
|
||||
lines = data.splitlines()
|
||||
# 只取最近 300 行
|
||||
tail = lines[-300:]
|
||||
|
||||
# 关键字筛选:若填写了筛选词,只保留包含该关键字的行
|
||||
kw = actions_filter_var.get().strip()
|
||||
if kw:
|
||||
tail = [ln for ln in tail if kw in ln]
|
||||
|
||||
actions_log_text.delete("1.0", "end")
|
||||
actions_log_text.insert("1.0", "\n".join(tail))
|
||||
actions_log_text.see("end")
|
||||
else:
|
||||
actions_log_text.delete("1.0", "end")
|
||||
actions_log_text.insert(
|
||||
"1.0", "暂无行为日志(logs/actions.log 不存在)"
|
||||
)
|
||||
except Exception as e:
|
||||
actions_log_text.delete("1.0", "end")
|
||||
actions_log_text.insert("1.0", f"读取行为日志失败:{e}")
|
||||
|
||||
ttk.Label(actions_log_top, text="关键字筛选:").pack(side=LEFT)
|
||||
ttk.Entry(actions_log_top, textvariable=actions_filter_var, width=16).pack(
|
||||
side=LEFT, padx=(0, 8)
|
||||
)
|
||||
ttk.Button(actions_log_top, text="刷新", command=refresh_actions_log).pack(
|
||||
side=LEFT
|
||||
)
|
||||
|
||||
# OCR结果显示
|
||||
ocr_results_top = ttk.Frame(ocr_results_tab)
|
||||
ocr_results_top.pack(fill=X, padx=10, pady=(10, 0))
|
||||
ocr_results_text = ScrolledText(ocr_results_tab)
|
||||
ocr_results_text.pack(fill=BOTH, expand=True, padx=10, pady=10)
|
||||
try:
|
||||
ocr_results_text.configure(font=("Consolas", 10))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def update_ocr_results(results):
|
||||
"""更新OCR结果标签页的显示"""
|
||||
try:
|
||||
lines = []
|
||||
lines.append("=" * 80)
|
||||
lines.append("OCR识别结果(基于最新截图)")
|
||||
lines.append("=" * 80)
|
||||
lines.append("")
|
||||
|
||||
if not results:
|
||||
lines.append('暂无OCR结果,请先点击"截图+OCR"按钮')
|
||||
else:
|
||||
# 按区域名称分组显示
|
||||
for region_name, desc, text_result, status in results:
|
||||
lines.append(f"【{region_name}】{desc}")
|
||||
lines.append(f" 状态: {status}")
|
||||
if text_result:
|
||||
# 如果文本较长,分行显示
|
||||
if len(text_result) > 100:
|
||||
lines.append(f" 识别文本: {text_result[:100]}...")
|
||||
lines.append(f" (完整文本: {text_result})")
|
||||
else:
|
||||
lines.append(f" 识别文本: {text_result}")
|
||||
else:
|
||||
lines.append(" 识别文本: (空)")
|
||||
lines.append("")
|
||||
|
||||
ocr_results_text.delete("1.0", "end")
|
||||
ocr_results_text.insert("1.0", "\n".join(lines))
|
||||
ocr_results_text.see("1.0")
|
||||
except Exception as e:
|
||||
ocr_results_text.delete("1.0", "end")
|
||||
ocr_results_text.insert("1.0", f"更新OCR结果失败:{e}")
|
||||
|
||||
ttk.Button(
|
||||
ocr_results_top, text="刷新", command=lambda: update_ocr_results([])
|
||||
).pack(side=LEFT)
|
||||
ttk.Label(ocr_results_top, text='(点击"截图+OCR"按钮自动更新)').pack(
|
||||
side=LEFT, padx=(10, 0)
|
||||
)
|
||||
|
||||
pump_logs()
|
||||
root.after(300, lambda _=None: refresh_preview() if image_var.get() else None) # type: ignore[misc]
|
||||
root.after(500, lambda _=None: refresh_stats()) # type: ignore[misc]
|
||||
root.after(500, lambda _=None: refresh_reservations()) # type: ignore[misc]
|
||||
root.after(500, lambda _=None: refresh_high_value_rooms()) # type: ignore[misc]
|
||||
root.after(500, lambda _=None: refresh_actions_log()) # type: ignore[misc]
|
||||
|
||||
# 定期刷新统计信息(每3秒)
|
||||
def auto_refresh_stats():
|
||||
if runner.is_running():
|
||||
refresh_stats()
|
||||
root.after(3000, lambda _=None: auto_refresh_stats()) # type: ignore[misc]
|
||||
|
||||
auto_refresh_stats()
|
||||
|
||||
def on_close():
|
||||
try:
|
||||
runner.stop()
|
||||
except Exception:
|
||||
pass
|
||||
root.destroy()
|
||||
|
||||
root.protocol("WM_DELETE_WINDOW", on_close)
|
||||
refresh_devices()
|
||||
root.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
from version import print_version_banner
|
||||
|
||||
Reference in new issue
Block a user