2025-09-06 16:06:30 +08:00
|
|
|
import sys
|
|
|
|
|
import os
|
|
|
|
|
from PySide6.QtWidgets import QApplication
|
|
|
|
|
from app.view import Window
|
|
|
|
|
from app.scheduler_manager import scheduler
|
|
|
|
|
|
2025-09-13 12:13:52 +08:00
|
|
|
def resource_path(relative_path):
|
|
|
|
|
"""获取资源的绝对路径。用于PyInstaller/Nuitka打包后定位资源文件。"""
|
|
|
|
|
if hasattr(sys, '_MEIPASS'):
|
|
|
|
|
return os.path.join(sys._MEIPASS, relative_path) # type: ignore
|
|
|
|
|
return os.path.join(os.path.abspath("."), relative_path)
|
|
|
|
|
|
2025-09-06 16:06:30 +08:00
|
|
|
def main():
|
2025-09-13 12:13:52 +08:00
|
|
|
# 设置基础路径
|
|
|
|
|
base_dir = os.path.abspath(".")
|
2025-09-06 16:06:30 +08:00
|
|
|
|
|
|
|
|
# 启动队列调度器
|
|
|
|
|
scheduler.start_queue_scheduler()
|
|
|
|
|
|
|
|
|
|
# 创建Qt应用
|
|
|
|
|
app = QApplication(sys.argv)
|
|
|
|
|
window = Window()
|
|
|
|
|
window.show()
|
|
|
|
|
window.setMicaEffectEnabled(True)
|
|
|
|
|
|
|
|
|
|
# 启动事件循环
|
|
|
|
|
exit_code = app.exec()
|
|
|
|
|
|
|
|
|
|
# 停止队列调度器
|
|
|
|
|
scheduler.stop_queue_scheduler()
|
|
|
|
|
|
|
|
|
|
sys.exit(exit_code)
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|