poc/project/llmclipboard/import_test.py
2025-03-02 18:56:33 +08:00

38 lines
1.1 KiB
Python
Raw Permalink 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 python
# -*- coding: utf-8 -*-
"""
LLMClipboard 导入测试脚本
"""
import sys
import os
import traceback
# 添加项目根目录到路径
print(f"当前工作目录: {os.getcwd()}")
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
print(f"Python路径: {sys.path}")
try:
print("尝试导入MainWindow和NotificationDialog")
from llmclipboard.gui import MainWindow, NotificationDialog
print("成功导入MainWindow和NotificationDialog")
print("尝试导入TextCaptureService")
from llmclipboard.app import TextCaptureService
print("成功导入TextCaptureService")
# 尝试导入apply_stylesheet函数
try:
print("尝试导入apply_stylesheet")
from qt_material import apply_stylesheet
print("成功导入apply_stylesheet")
except ImportError as e:
print(f"qt_material导入错误: {e}")
# 如果qt_material未安装创建一个空的apply_stylesheet函数
print("qt_material未安装使用空的apply_stylesheet函数")
except Exception as e:
print(f"导入模块时出错: {e}")
traceback.print_exc()