Files
ykxmz/_build/update_lan_assertions.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

84 lines
3.4 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 -*-
"""更新过时断言:局域网功能已经(按要求)加回来了。
背景:
早先用户要求"既然用中转站了,局域网那套删掉",
于是 test_watch_relayonly.py 里写了:
没有 Discovery 调用 / 没有「自动搜索电脑」/ 没有 DiscoveryCore
后来用户又要求"首页加一个进入局域网连接页面",
这些断言就过时了 —— 功能回来了,断言还说不能有。
现在正确的设计是:
* 首页**默认**还是"输入配对码连接"(走中转)
* 但多了一个「局域网连接(同一个 WiFi)」入口,进去能搜局域网
* 原来那种"自动搜索弹一堆结果在首页"的旧交互不在了
"""
from __future__ import annotations
import ast
import sys
from pathlib import Path
TEST = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\_tests"
r"\test_watch_relayonly.py")
OLD = ''' print()
print("二、局域网那套已清掉")
check("没有 Discovery 调用", "Discovery." not in code)
check("没有 foundBox", "foundBox" not in code)
check("没有 discovering", "discovering" not in code)
check("没有「手动输入地址」按钮",
'bigButton("手动输入地址"' not in code)
check("没有 toggleManual", "toggleManual" not in code)
check("没有 hostInput", "hostInput" not in code)
check("没有 portInput", "portInput" not in code)
check("没有「自动搜索电脑」", "自动搜索电脑" not in code)
check("没有 DiscoveryCore 引用", "DiscoveryCore" not in code)'''
NEW = ''' print()
print("二、局域网入口按新设计存在(但不再是旧交互)")
# 注意:早期这里断言的是"局域网那套已清掉",
# 那是用户要求删除时的版本。后来用户又要求把局域网连接加回来
# (首页 -> 局域网连接页面 -> 搜索/直连),所以这些断言反过来了。
check("首页有局域网入口",
'bigButton("局域网连接(同一个 WiFi)"' in code)
check("有独立的局域网页面", "private void buildLanPanel()" in code)
check("页面里能广播搜索", "Discovery.search(" in code)
check("用 DiscoveryCore 的结果类型", "DiscoveryCore.Found" in code)
# 旧交互确实不该再有:首页直接弹搜索框、手动填 IP 那一套
check("首页没有旧的「自动搜索电脑」按钮",
'bigButton("自动搜索电脑"' not in code)
check("没有旧的手动输入地址按钮",
'bigButton("手动输入地址"' not in code)
check("没有 toggleManual(旧交互)", "toggleManual" not in code)
check("首页没有裸的 hostInput", "hostInput" not in code)'''
# 顺带:标题也要改,不然读起来矛盾
TITLE_OLD = 'print("二、局域网那套已清掉")'
TITLE_NEW = 'print("二、局域网入口(新设计)")'
def main() -> int:
text = TEST.read_text(encoding="utf-8")
if "局域网入口按新设计存在" in text:
print(" 已经更新过")
return 0
if OLD not in text:
print(" [失败] 锚点没找到")
return 1
text = text.replace(OLD, NEW, 1)
TEST.write_text(text, encoding="utf-8", newline="\n")
try:
ast.parse(text)
print(" 已更新过时的局域网断言")
except SyntaxError as exc:
print(f" 语法错误: 行 {exc.lineno}: {exc.msg}")
return 1
return 0
if __name__ == "__main__":
sys.exit(main())