-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (35 loc) · 1.12 KB
/
main.py
File metadata and controls
46 lines (35 loc) · 1.12 KB
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
#!/usr/bin/python3
import sys
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication
from const.CONSTANTS import OP_SYSTEM
from sources.mainWindow import MainWindow
def except_hook(cls, exception, traceback):
sys.__excepthook__(cls, exception, traceback)
def main():
app = QApplication(sys.argv)
application = MainWindow()
application.setWindowTitle('SC-GUI')
application.setWindowIcon(QIcon('icons/logo/logo.svg'))
# application.setWindowFlag(QtCore.Qt.FramelessWindowHint)
application.show()
# application.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sys.excepthook = except_hook
print("Started")
sys.exit(app.exec())
def cleanup():
from os import walk
fnames = []
for (dirpath, dirnames, filenames) in walk('logs'):
fnames.extend(filenames)
break
for f in fnames:
if f != 'errors_QT_logs.log':
with open('logs/' + f, 'w') as f:
f.truncate(0)
if __name__ == "__main__":
cleanup()
print("Starting...")
print(f"* OPERATING SYSTEM: {OP_SYSTEM}")
main()
print("Closing")