Files
cutThenThink/src/main.py
congsh e853161975 refactor: 重构为极简截图上传工具
- 简化项目定位:从智能工具转为极简截图上传工具
- 移除重型依赖:torch、transformers、paddleocr、SQLAlchemy
- 新增轻量级核心模块:
  - config.py: 简化 YAML 配置管理
  - database.py: 原生 SQLite 存储
  - screenshot.py: 截图功能(全屏/区域)
  - uploader.py: 云端上传(支持 custom/telegraph/imgur)
  - plugins/ocr.py: 可选 RapidOCR 插件
- 重写主窗口:专注核心功能,移除复杂 UI
- 更新依赖:核心 ~50MB,OCR 可选
- 更新文档:新的 README 和需求分析 v2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 15:50:51 +08:00

53 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CutThenThink - 极简截图上传工具
截图 → 上传 → 分类浏览
核心功能:
- 截图(全屏/区域)
- 上传到云端
- 历史记录管理
- 可选 OCR 文字识别
"""
import sys
import os
def setup_path():
"""设置Python路径兼容开发和打包环境"""
if getattr(sys, 'frozen', False):
# PyInstaller打包后的环境
base_path = sys._MEIPASS
src_path = os.path.join(base_path, 'src')
if os.path.exists(src_path):
sys.path.insert(0, src_path)
else:
sys.path.insert(0, base_path)
else:
# 开发环境
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, current_dir)
setup_path()
def main():
"""应用入口"""
from src.gui.main_window import MainWindow
from PyQt6.QtWidgets import QApplication
app = QApplication(sys.argv)
app.setStyle("Fusion")
window = MainWindow()
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()