Repository navigation
更新版本到0.5.5.rc1 - #31
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 将项目版本更新到 0.5.5.rc1,同步升级运行环境到 Python 3.11,并新增「版本」页面用于展示软件提交历史与管理远程固件历史/详情/下载;同时对日志体系、固件管理与电源协议常量进行了重构,以提升可维护性与一致性。
Changes:
- 版本与环境升级:更新
pyproject.toml/Resources/Config/config.json/README.md,并将入口标注升级到 Python 3.11 - 新增
VersionPage:集成软件提交历史(本地 git log + GitHub commits API)与远程固件历史/详情/下载 - 基础设施调整:引入
get_logger()子 logger 模式、固件历史/详情缓存、抽离电源协议常量到app/core/const.py,并更新 Windows 构建工作流为 x86
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| start.py | 更新 Python 版本标注并切换到新的 logger 获取方式 |
| script/sim_power_device.py | 将脚本输出从 print 迁移到 logging,并统一日志格式 |
| Resources/Theme/qss/light/VersionPage.qss | 新增 VersionPage 浅色主题样式 |
| Resources/Theme/qss/dark/VersionPage.qss | 新增 VersionPage 深色主题样式 |
| Resources/Config/config.json | 版本号与默认主题/高 DPI 等配置更新 |
| README.md | 更新页面说明与环境要求(Python >= 3.11) |
| pyproject.toml | 更新项目版本与依赖约束(含 capstone 约束) |
| docs/AGENTS.md | 更新项目结构与开发命令说明,补充 Version 子系统描述 |
| config/config.py | 调整目录解析与日志初始化;新增 get_logger() |
| config/init.py | 导出 get_logger 以供各模块使用 |
| app/window/navigation.py | 将 VersionPage 加入导航与页面创建流程 |
| app/window/main_window.py | 调整 DynamicIsland 初始化与启动流程 |
| app/widgets/pages/page_version.py | 新增版本与固件管理页面实现 |
| app/widgets/pages/page_power.py | PowerPage 日志迁移到 logger;移除页面自写日志文件逻辑等 |
| app/widgets/pages/page_home.py | 轻微格式调整(空行) |
| app/widgets/pages/page_device.py | DevicePage 与 BluetoothSession 日志切换到 get_logger() |
| app/widgets/pages/page_daplink.py | DaplinkPage 日志切换到 get_logger() 并简化日志前缀 |
| app/widgets/pages/init.py | 导出新增的 page_version |
| app/widgets/components/splashscreen/splashscreen.py | 清理未使用的标题栏相关代码/导入 |
| app/widgets/chart/realtime_chart_widget.py | RealtimeChartWidget 日志切换到 get_logger() |
| app/session/session_serial.py | SerialSession 日志切换到 get_logger() 并简化部分日志内容 |
| app/session/session_power.py | 电源协议常量/类型迁移到 app.core.const;增强部分错误日志 |
| app/session/session_daplink.py | DAPLink 会话日志切换到 get_logger();调整下载地址解析参数传递 |
| app/session/session_bluetooth.py | 蓝牙会话日志切换到 get_logger() |
| app/protocol/payLoad.py | 轻微格式调整(空行) |
| app/manager/manager_update.py | 更新检查请求统一走 build_request();切换到 get_logger() |
| app/manager/manager_stylesheet.py | 在 StyleSheet 枚举中注册 VERSION_PAGE |
| app/manager/manager_font.py | 字体管理切换到 get_logger() 并调整导入 |
| app/manager/manager_firmware.py | 增加固件历史/详情线程与缓存管理;下载支持指定 release |
| app/core/update_request.py | 新增网络请求构建辅助函数 build_request() |
| app/core/const.py | 新增电源协议常量与部分 DAPLink 常量集中定义 |
| app/controllers/controller_power_page.py | 注释 mockButton 的控制器绑定(与页面改动保持一致) |
| .gitignore | 忽略 Resources/Cache/ 缓存目录 |
| .github/workflows/buildEXE.yml | Windows 构建改为 x86 Python,并更新产物命名与 UPX 版本 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._appendLog(self._diagnoseDebugSnapshot(snapshot)) | ||
|
|
||
| def _diagnoseDebugSnapshot(self, snapshot: DebugSnapshot) -> str: | ||
| @ staticmethod |
| file_path = str(Path(payload.file_path or "").resolve()) | ||
| file_ext = Path(file_path).suffix.lower().lstrip(".") | ||
| base_address = self._resolve_download_address(payload.base_address, f".{file_ext}", target_info) | ||
| base_address = self._resolve_download_address(payload.base_address, file_ext, target_info) |
Comment on lines
46
to
+47
| def showDynamicIsland(self, title: str, content: str = "", level: str = "info", duration: int = 3200): | ||
| if hasattr(self, "dynamicIsland"): | ||
| self.dynamicIsland.notify(title, content, level, duration) | ||
| self.dynamicIsland.notify(title, content, level, duration) |
Comment on lines
432
to
+433
| except Exception: | ||
| pass | ||
| logger.error(f"Failed to detach serial session on {self._session.cfg.port}") |
Comment on lines
34
to
38
| def _detect_base_dir() -> Path: | ||
| """Return the project root, respecting frozen (cx_Freeze) layouts.""" | ||
| """Return the project root, respecting frozen (cx_Freeze) layouts返回项目根,但要遵守冻结(cx_Freeze)布局.""" | ||
| if getattr(sys, "frozen", False): | ||
| return Path(sys.executable).resolve().parent | ||
| return Path(__file__).resolve().parent.parent |
Comment on lines
14
to
+18
| import logging | ||
| import os | ||
| import shutil | ||
| import sys | ||
| from datetime import datetime | ||
| import time |
Comment on lines
+22
to
+23
| from qfluentwidgets import FluentIcon as FIF | ||
| from qfluentwidgets import qconfig, QConfig, ConfigItem, OptionsConfigItem, OptionsValidator, BoolValidator |
Comment on lines
298
to
300
| except Exception as exc: | ||
| logger.error(f"{self.__class__.__name__}: {e}") | ||
| logger.error(f"{e}") | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.