-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun.py
executable file
·43 lines (32 loc) · 1.22 KB
/
run.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
#!/usr/bin/env python3
import logging
import sys
from multiprocessing import freeze_support
from PyQt5 import QtWidgets
from transcriber.logger import Logger
from transcriber.transcriber import Transcriber
LOG_FORMAT = "(%(asctime)s) %(message)s"
VERSION = "{TRAVIS_TAG}"
class TranscriberGUI(QtWidgets.QMainWindow):
def __init__(self):
super(TranscriberGUI, self).__init__()
self.tabs = QtWidgets.QTabWidget()
self.transcriber = Transcriber(self)
self.tabs.addTab(self.transcriber, "Transcriber")
self.logger = Logger(self)
self.logger.setFormatter(logging.Formatter(LOG_FORMAT, "%H:%M:%S"))
logging.getLogger().addHandler(self.logger)
logging.getLogger().setLevel(logging.DEBUG)
self.tabs.addTab(self.logger, "Log")
self.layout = QtWidgets.QVBoxLayout()
self.layout.addWidget(self.tabs)
self.setCentralWidget(QtWidgets.QWidget(self))
self.centralWidget().setLayout(self.layout)
self.setWindowTitle(f"Transcriber {VERSION}")
if __name__ == "__main__":
freeze_support()
app = QtWidgets.QApplication([])
app.setStyle("Fusion")
transcriber = TranscriberGUI()
transcriber.show()
sys.exit(app.exec_())