forked from jianchang512/pyvideotrans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsp.py
35 lines (33 loc) · 1.1 KB
/
sp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
import subprocess
import sys
import os
import threading
from PyQt5.QtWidgets import QApplication
from videotrans.spwin import MainWindow
import qdarkstyle
if __name__ == "__main__":
app = QApplication(sys.argv)
main = MainWindow()
try:
with open(os.path.join(os.getcwd(),'videotrans/styles/style.qss'), 'r', encoding='utf-8') as f:
main.setStyleSheet(f.read())
app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyqt5'))
except:
pass
main.show()
try:
def init():
from videotrans.util import tools
from videotrans.configure import config
try:
threading.Thread(target=tools.get_edge_rolelist).start()
threading.Thread(target=tools.get_elevenlabs_role, args=(True,)).start()
os.makedirs(config.rootdir + "/models", exist_ok=True)
os.makedirs(config.rootdir + "/tmp", exist_ok=True)
except Exception as e:
pass
threading.Thread(target=init).start()
except:
pass
sys.exit(app.exec())