Files
ykxmz/_build/fix_ui_cards.py
T
xmz7891 b705216e4a ykxmz 1.5.0锛氫慨澶嶆墜琛ㄧ TLS 璇佷功鏍¢獙 + MTU 淇缃戠粶绋冲畾鎬?
琚帶绔?- 淇 MTU 闂锛氬す MSS + 璺緞 MTU 鎺㈡祴锛堝叕缃戝彲鐢ㄧ巼 48% -> 100%锛?- 澶嶇敤 HTTP 杩炴帴锛堝厤鎺夋瘡娆℃柊寤?TLS 鐨?30% 鎻℃墜澶辫触锛?- 姣忓垎閽熷洖澶存壘灞€鍩熺綉锛岃嚜鍔ㄥ垏鍥炲揩 400 鍊嶇殑璺緞
- 鐢婚潰蹇冭烦甯э細闈欐鏃剁渷娴侀噺锛屽鎴风浠嶇煡閬撴祦鏄椿鐨?- 閿佸睆鏃剁粰鍑哄彲鎿嶄綔鐨勬彁绀?
鎵嬭〃绔?- 鍐呯疆 GTS Root R4 / GlobalSign Root CA锛屼慨 SSLHandshakeException
- 杩炴帴閿欒缈昏瘧鎴愪汉璇濓紙璇佷功/鏃堕棿/瑙f瀽/瓒呮椂鍒嗗埆鎻愮ず锛?- 缁忎腑杞繛涓婂悗鐢ㄦ湇鍔″櫒鎶ョ殑鍦板潃鍒锋柊宸查厤瀵硅褰?- 鏂板灞€鍩熺綉杩炴帴椤甸潰銆佹湇鍔″櫒寤惰繜妫€娴?
鏈嶅姟鍣ㄧ
- 鏀寔 chunked 璇锋眰浣擄紙淇瘡 16 绉掍竴娆$殑杩炴帴閿欎贡涓庡ぇ闈㈢Н 502锛?- 缃戠粶璋冧紭鑴氭湰 net-tune.sh锛堝紑鏈鸿嚜鍔ㄥ簲鐢級
- 绠$悊椤碉細鎵归噺鍒犻櫎銆佺綉缁滀綋妫€銆佷笅杞藉尯
- 闅ч亾鏀?HTTP/2 + 鍙岃繛鎺?
鏂囨。
- 璁稿彲鍗忚 / 瀹夎鍓嶅繀璇?/ 瀹夎鍚庨』鐭ワ紙浣滆€咃細灏忛害瀛愶級
2026-10-06 19:01:05 +08:00

98 lines
3.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""修界面:卡片根本没显示出来。
我写的 _card() 是这样的:
def _card(self, parent):
outer = tk.Frame(parent, bg=BORDER) # 外层:边框色
inner = tk.Frame(outer, bg=CARD) # 内层:白底
inner.pack(fill="both", expand=True, padx=1, pady=1) # 挂到 outer
return inner # ← 返回内层
调用处:card = self._card(page); card.pack(...)
card.pack() 是 inner.pack(),而 inner 的父控件是 **outer** ——
所以它被挂回 outer,而 **outer 从来没有被 pack 进 page**。
结果:两张卡片完全看不见,窗口高度只有 199px,
但控件都"存在"(walk 能列出来),测试也就查不出来。
修法:_card 返回 outer,调用处 pack outer。
"""
from __future__ import annotations
import ast
import sys
from pathlib import Path
UI = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\windows\lanremote"
r"\ui.py")
OLD = ''' def _card(self, parent) -> tk.Frame:
"""一个白底圆角感的卡片(tkinter 没有圆角,用边框色模拟)。"""
outer = tk.Frame(parent, bg=BORDER)
inner = tk.Frame(outer, bg=CARD)
inner.pack(fill="both", expand=True, padx=1, pady=1)
return inner'''
NEW = ''' def _card(self, parent) -> tk.Frame:
"""一个白底圆角感的卡片(tkinter 没有圆角,用边框色模拟)。
返回的是**外层** frame —— 调用处要 pack 它。
踩过的坑:一开始返回 inner,而 inner 的父控件是 outer,
于是 inner.pack() 挂回 outer,outer 自己从没被 pack,
结果卡片完全不显示(窗口高度只剩 199px)。
"""
outer = tk.Frame(parent, bg=BORDER)
inner = tk.Frame(outer, bg=CARD)
inner.pack(fill="both", expand=True, padx=1, pady=1)
return outer'''
# 卡片内容要挂在 inner 上,所以取 inner
CARD_USE_OLD = ''' card = self._card(page)
card.pack(fill="x", pady=(16, 0))
inner = tk.Frame(card, bg=CARD)
inner.pack(fill="x", padx=16, pady=14)
'''
CARD_USE_NEW = ''' card = self._card(page)
card.pack(fill="x", pady=(16, 0))
inner = tk.Frame(card.winfo_children()[0], bg=CARD)
inner.pack(fill="x", padx=16, pady=14)
'''
OPTIONS_OLD = ''' options = self._card(page)
options.pack(fill="x", pady=(12, 0))
opt_inner = tk.Frame(options, bg=CARD)
opt_inner.pack(fill="x", padx=16, pady=12)'''
OPTIONS_NEW = ''' options = self._card(page)
options.pack(fill="x", pady=(12, 0))
opt_inner = tk.Frame(options.winfo_children()[0], bg=CARD)
opt_inner.pack(fill="x", padx=16, pady=12)'''
def main() -> int:
text = UI.read_text(encoding="utf-8")
ok = True
if "返回的是**外层** frame" in text:
print(" 已经修过")
return 0
for old, new, label in ((OLD, NEW, "_card 返回外层"),
(CARD_USE_OLD, CARD_USE_NEW, "配对码卡片内容挂 inner"),
(OPTIONS_OLD, OPTIONS_NEW, "选项卡片内容挂 inner")):
if old in text:
text = text.replace(old, new, 1)
print(f" {label}")
else:
print(f" [失败] {label} —— 锚点没找到")
ok = False
UI.write_text(text, encoding="utf-8", newline="\n")
ast.parse(text)
print(" ui.py 语法 OK")
return 0 if ok else 1
if __name__ == "__main__":
sys.exit(main())