-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.py
65 lines (47 loc) · 1.32 KB
/
app.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os, sys
os.environ["PATH"] += os.pathsep if os.environ["PATH"][-1] != os.pathsep else ""
os.environ["PATH"] += os.pathsep.join([os.getcwd()])
from PyQt5.QtWidgets import QApplication
# auto compile resources .qrc
import pyqt5ac
pyqt5ac.main(
initPackage=False,
force=False,
ioPaths=[
["resources/resources.qrc", "resources.py"]
])
import resources
import plugin
from main import Window
# pip install QDarkStyle
# import qdarkstyle
# pip install qtmodern
# import qtmodern.styles
# import qtmodern.windows
# pip install qtstylish
# import qtstylish
# pip install qt_material
# from qt_material import apply_stylesheet
# hook I/O print to redirect output to debugviewer
from win32api import OutputDebugString
class LogWrapper:
def flush(self): pass
def write(self, s):
for line in s.replace('\t', ' ').split('\n'):
line = line.strip()
if len(line) > 0:
OutputDebugString(line)
sys.stdout = LogWrapper()
sys.stderr = LogWrapper()
if __name__ == "__main__":
app = QApplication(sys.argv)
win = Window(app)
app.setStyle("fusion")
# app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
# qtmodern.styles.dark(app)
# win = qtmodern.windows.ModernWindow(win)
# app.setStyleSheet(qtstylish.light())
# apply_stylesheet(app, theme='dark_teal.xml')
plugin.initialize(win)
win.show()
sys.exit(app.exec_())