root
|
04fb72c14c
|
fix
|
2025-07-12 18:55:05 +08:00 |
root
|
e4d4677f3a
|
fix: 添加auth功能
|
2025-07-12 18:01:17 +08:00 |
root
|
493e347b03
|
fix
|
2025-07-12 14:38:15 +08:00 |
root
|
31de1e5a4d
|
fix: 修复命令行工具
|
2025-07-12 13:44:57 +08:00 |
root
|
81035caf0e
|
fix: 添加工作流
|
2025-07-12 12:45:21 +08:00 |
root
|
bc19461d8a
|
fix
|
2025-07-12 11:31:03 +08:00 |
root
|
7b50c6e28e
|
json rpc commander 封装
|
2025-07-11 21:27:17 +08:00 |
root
|
2a16067367
|
fix
|
2025-07-11 20:38:09 +08:00 |
root
|
7edf8b7335
|
refactor: 移动JSON-RPC模块到公共位置并修复模板导入显示问题
- 将JSON-RPC模块从ai_video移动到utils作为公共模块
- 更新所有相关文件的导入路径
- 重构template_manager.py使用标准JSON-RPC协议
- 修复模板导入成功但前端显示失败的问题
- 添加模板相关的错误码定义
- 改进进度报告使用JSON-RPC通知
- 移除旧的直接JSON输出代码
修复内容:
- python_core/utils/jsonrpc.py: 新增公共JSON-RPC模块
- python_core/services/template_manager.py: 使用JSON-RPC协议
- python_core/ai_video/video_generator.py: 更新导入路径
- python_core/ai_video/api_client.py: 更新导入路径
|
2025-07-10 21:07:14 +08:00 |
root
|
59ec478665
|
fix
|
2025-07-10 17:15:49 +08:00 |
root
|
22097ca2b3
|
fix
|
2025-07-10 17:10:52 +08:00 |
root
|
1ff49a3c26
|
refactor: 统一使用相对导入,规范 Python 包结构
🏗️ **Python 包结构规范化**:
1. **导入方式统一**:
- 移除所有 sys.path.append() hack 方式
- 统一使用相对导入 (from ..config import settings)
- 符合 Python 包管理最佳实践
2. **包结构简化**:
- 简化 python_core/__init__.py,移除复杂依赖
- 避免包初始化时的循环导入问题
- 清理不必要的 try-except 导入逻辑
3. **模块运行方式**:
- 支持标准的模块运行: python -m python_core.ai_video.video_generator
- Rust 代码使用 -m 参数调用 Python 模块
- 相对导入在模块运行时正常工作
4. **涉及文件修改**:
- python_core/__init__.py: 简化包初始化
- python_core/ai_video/video_generator.py: 相对导入
- python_core/ai_video/cloud_storage.py: 移除 fallback 逻辑
- python_core/ai_video/api_client.py: 统一相对导入
- python_core/video_processing/core.py: 相对导入
- python_core/audio_processing/core.py: 相对导入
- python_core/utils/logger.py: 相对导入
- python_core/services/*.py: 统一相对导入
- src-tauri/src/commands/ai_video.rs: 使用模块运行方式
5. **代码质量提升**:
- 移除重复的 sys.path 操作
- 清理冗余的 try-except 导入
- 统一的错误处理方式
- 更清晰的模块依赖关系
✅ **改进效果**:
- 符合 Python 最佳实践 ✓
- 代码结构更清晰 ✓
- 易于维护和测试 ✓
- 消除 hack 式路径操作 ✓
- 支持标准模块运行 ✓
现在整个 Python 包结构规范且易于维护!
|
2025-07-10 14:47:32 +08:00 |
root
|
7d72e07639
|
first commit
|
2025-07-10 09:41:40 +08:00 |