mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 17:10:43 +00:00
被控端 - 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%) - 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败) - 每分钟回头找局域网,自动切回快 400 倍的路径 - 画面心跳帧:静止时省流量,客户端仍知道流是活的 - 锁屏时给出可操作的提示 手表端 - 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException - 连接错误翻译成人话(证书/时间/解析/超时分别提示) - 经中转连上后用服务器报的地址刷新已配对记录 - 新增局域网连接页面、服务器延迟检测 服务器端 - 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502) - 网络调优脚本 net-tune.sh(开机自动应用) - 管理页:批量删除、网络体检、下载区 - 隧道改 HTTP/2 + 双连接 文档 - 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
68 lines
2.0 KiB
Python
68 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""让 verify_all 的每个 python 阶段都打印 FAIL 详情。
|
|
|
|
原来一律 `Select-Object -Last 4`,只看到最后几行 ——
|
|
失败了却不知道是哪几条,得手动再跑一遍。
|
|
改成:FAIL 行 + 最后一行汇总,一次就能看到问题。
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
VERIFY = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\_tests"
|
|
r"\verify_all.ps1")
|
|
|
|
|
|
def main() -> int:
|
|
raw = VERIFY.read_bytes()
|
|
had_bom = raw.startswith(b"\xef\xbb\xbf")
|
|
text = raw.decode("utf-8-sig")
|
|
|
|
if "Show-Fails" in text:
|
|
print(" 已经加过")
|
|
return 0
|
|
|
|
# 加一个辅助函数
|
|
helper_anchor = "function Stop-Strays {"
|
|
helper = '''function Show-Fails($lines) {
|
|
# 失败的阶段光看最后几行没用,得把 [FAIL] 打出来
|
|
$fails = $lines | Select-String -Pattern '\\[FAIL\\]'
|
|
if ($fails) {
|
|
$fails | Select-Object -First 8 | ForEach-Object {
|
|
Write-Host " $($_.Line.Trim())" -ForegroundColor Red
|
|
}
|
|
}
|
|
$lines | Select-Object -Last 1 | ForEach-Object {
|
|
Write-Host " $($_.Trim())"
|
|
}
|
|
}
|
|
|
|
''' + helper_anchor
|
|
|
|
text = text.replace(helper_anchor, helper, 1)
|
|
print(" 加了 Show-Fails 辅助函数")
|
|
|
|
# 把所有 `2>&1 | Select-Object -Last N` 换成先收集再 Show-Fails
|
|
pattern = re.compile(
|
|
r"& python \(Join-Path \$root \"([^\"]+)\"\) 2>&1 \|\r?\n"
|
|
r"\s*Select-Object -Last \d+")
|
|
|
|
def repl(match):
|
|
script = match.group(1)
|
|
return (f'$out = & python (Join-Path $root "{script}") 2>&1\r\n'
|
|
f' Show-Fails $out')
|
|
|
|
text, count = pattern.subn(repl, text)
|
|
print(f" 改了 {count} 个 python 阶段")
|
|
|
|
VERIFY.write_bytes((b"\xef\xbb\xbf" if had_bom else b"")
|
|
+ text.replace("\r\n", "\n").encode("utf-8"))
|
|
print(f" BOM {'保留' if had_bom else '无'}")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|