Skip to content

修复构建脚本 & 新增连接类型检测#4

Merged
SMWHff merged 4 commits into
mainfrom
refactor/gdi-device-prefix
Jul 9, 2026
Merged

修复构建脚本 & 新增连接类型检测#4
SMWHff merged 4 commits into
mainfrom
refactor/gdi-device-prefix

Conversation

@SMWHff

@SMWHff SMWHff commented Jul 9, 2026

Copy link
Copy Markdown
Owner

变更内容

1. 修复构建脚本

  • scripts/build/clean.sh: 移除误用的 -prune,确保 pycache 清理生效
  • scripts/build/build.sh: 添加 Nuitka metadata CLI 参数

2. 新增连接类型检测

新增 DISPLAYCONFIG_TARGET_DEVICE_NAME.targetFlags 连接类型解析,在 --prop 输出中展示 ConnectorType

  • constants.py: 新增 targetFlags 常量和 CONNECTOR_TYPE_MAP
  • utils.py: 新增 get_connector_type(path) 解析函数
  • api.py: get_display_props() 输出 ConnectorType
  • 单元测试: 7 项覆盖所有连接类型
  • 集成测试: 验证 connector_type 字段

Test plan

  • ruff check 零错误
  • 413 项测试全部通过
  • import 和版本号验证正常

SMWHff added 4 commits July 9, 2026 09:02
- clean.sh: 移除 find 命令中误用的 -prune,确保 __pycache__ 能被正确删除
- build.sh: 为 Nuitka 添加 --company-name / --product-name / --file-version
  元数据参数,避免仅依赖 pyproject.toml 的 [tool.nuitka] 配置
- 两者均使用 set -euo pipefail 替代 set -e,提升健壮性
新增 4 个测试验证:
- --reflect x 与 -y 同时使用时,--reflect 优先
- --reflect xy 与 -x 同时使用时,--reflect 优先,记录警告
- --reflect y 与 -x 同时使用时,--reflect 优先,记录警告
- --reflect normal(清除)后 -x 仍生效
- winrandr/win32/constants.py:新增 targetFlags 连接类型位常量和映射表
- winrandr/win32/utils.py:新增 get_connector_type(path) 解析函数
- winrandr/api.py:get_display_props() 输出 ConnectorType
- 重构 get_display_props 提取 _get_config_props 以降低循环复杂度
- tests/unit/win32/test_connector_type.py:7 项单元测试覆盖所有连接类型
- tests/integration/test_api.py:集成测试验证 connector_type 字段
@SMWHff SMWHff changed the title 修复构建脚本:clean.sh 移除误用的 -prune,build.sh 添加 Nuitka metadata CLI 参数 修复构建脚本 & 新增连接类型检测 Jul 9, 2026
@SMWHff SMWHff merged commit 85892fe into main Jul 9, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant