refactor: 业务核心从 image_generator.py 拆到 core/
5082 行的怪兽塞了 12 个类(数据库/历史/Worker/词库/UI),现在按职责拆开: core/paths.py get_app_data_path + save_png_with_validation + 启动迁移 core/database.py DatabaseManager + hash_password core/history.py HistoryItem + HistoryListModel + HistoryManager core/generation.py ImageGenerationWorker + Gemini 模型常量 core/jewelry.py DEFAULT_JEWELRY_LIBRARY + JewelryLibraryManager + PromptAssembler image_generator.py 5082 → 3781 行,剩下全是 QWidget UI 类 (LoginDialog / DraggableThumbnail / DragDropScrollArea / ImageGeneratorWindow / StyleDesignerTab + utils + main),task #19 QML 全量切换后整体删除。 外部消费者改 import: task_queue.py / temp_clean.py: from image_generator → from core.generation image_generator.py 顶部 from core.* 引入,LoginDialog 等内部代码无感知 冒烟测试:image_generator/task_queue/core 各自 import 通过,类身份正确。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Showing
9 changed files
with
383 additions
and
2 deletions
core/__init__.py
0 → 100644
core/database.py
0 → 100644
core/generation.py
0 → 100644
core/history.py
0 → 100644
This diff is collapsed.
Click to expand it.
core/jewelry.py
0 → 100644
This diff is collapsed.
Click to expand it.
core/paths.py
0 → 100644
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment