mirror of
https://github.com/YaoFANGUK/video-subtitle-remover.git
synced 2026-05-13 14:47:34 +08:00
添加PyInstaller打包支持和运行时路径修复
- 创建PyInstaller规范文件和打包脚本 - 修复开发/打包环境路径兼容性问题 - 添加PaddleOCR运行时依赖(opencv-contrib-python, pypdfium2, pyclipper) - 支持打包后的多进程启动 - 修复图标路径和翻译文件路径 - 清理重复的模型和FFmpeg文件 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
from enum import Enum
|
||||
|
||||
from qfluentwidgets import getIconColor, Theme, FluentIconBase
|
||||
@@ -8,4 +10,12 @@ class MyFluentIcon(FluentIconBase, Enum):
|
||||
|
||||
def path(self, theme=Theme.AUTO):
|
||||
# getIconColor() return "white" or "black" according to current theme
|
||||
return f'./ui/icon/{self.value}_{getIconColor(theme)}.svg'
|
||||
# 支持打包环境和开发环境
|
||||
if getattr(sys, 'frozen', False):
|
||||
# 打包环境:使用 sys._MEIPASS 作为基础路径
|
||||
base_path = sys._MEIPASS
|
||||
else:
|
||||
# 开发环境:使用相对路径
|
||||
base_path = os.path.join(os.path.dirname(__file__), '..')
|
||||
|
||||
return os.path.join(base_path, 'ui', 'icon', f'{self.value}_{getIconColor(theme)}.svg')
|
||||
|
||||
Reference in New Issue
Block a user