feat(core): 添加 NSP 处理相关功能#8
Merged
Merged
Conversation
- 在 Windows 系统下使用 win32api.ShellExecute 启动 NSP 程序- 在非 Windows 系统下使用 nohup 命令启动 NSP 程序- 确保 NSP程序在完全独立的进程中运行,不继承控制台 - 添加启动成功后的提示信息 - 优化代码结构,提高可读性和可维护性
…平台兼容性 - 修复了 Linux 版本的 NSP启动方式,增加了进程信息日志输出
- 将字符串格式化方法从传统的 % 格式化改为更现代的 f-string 格式化 - 提高了代码的可读性和维护性
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces comprehensive NSP (NeuroSongSpider) process management functionality with enhanced cross-platform support. The main focus is on improving Windows process creation using win32api while maintaining compatibility with Unix systems.
Key Changes:
- Enhanced Windows process management using win32api with fallback mechanisms
- Added cross-platform process launching with nohup support for Unix systems
- Simplified version information extraction using bitwise operations
- Improved user experience with status messages and background operation notifications
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/core/NSP_handle.py | Major refactoring of process management with win32api integration, improved version extraction logic, and enhanced user feedback |
| .vscode/settings.json | Added "nohup" to VS Code spell checker dictionary |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
feat(core): 添加 NSP 处理相关功能
Copilot
This pull request introduces significant updates to the
NSP_handle.pyscript to improve process handling, especially for Windows systems, and includes minor adjustments to other files. The main changes involve adding support forwin32apito handle process creation on Windows, enhancing cross-platform compatibility, and refining version retrieval logic.Process Handling Updates:
win32api,win32con, andwin32processmodules for advanced process management on Windows systems, including creating fully detached processes usingwin32process.CreateProcess. A fallback mechanism is provided for systems withoutpywin32installed. (src/core/NSP_handle.py, [1] [2]nohupfor detached execution, ensuring compatibility with Unix-based systems. (src/core/NSP_handle.py, src/core/NSP_handle.pyL52-R116)Version Retrieval Logic:
GetFileVersionInfoAPI by using bitwise operations instead of helper methods likeHIWORDandLOWORD. (src/core/NSP_handle.py, src/core/NSP_handle.pyL268-R323)Usability Enhancements:
src/core/NSP_handle.py, src/core/NSP_handle.pyR476-R482)Code Cleanup:
src/core/NSP_handle.py, [1] [2] [3] [4]Minor Adjustments:
.vscode/settings.jsonto include "nohup" in the recognized keywords. (.vscode/settings.json, .vscode/settings.jsonR22)