35 lines
900 B
Python

import sys
import os
from PySide6.QtWidgets import QApplication
from app.view import Window
from app.scheduler_manager import scheduler
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)
def main():
# 设置基础路径
base_dir = os.path.abspath(".")
# 启动队列调度器
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()