-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
46 lines (35 loc) · 1.03 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
44
45
46
import logging
import sys
from qt import QtWidgets, QtCore
logger = logging.getLogger("VortexUI")
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
_instance = None
def standalone():
app = QtWidgets.QApplication(sys.argv)
app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
win = embed()
win.show()
sys.exit(app.exec_())
def embed():
global _instance
try:
_instance.close()
except:
pass
logger.debug("Starting boot process")
from vortex.ui import config
from vortex.ui import mainwindow
from slither.vortexmodel import slithermodel # temp just for proto
uiConfig = config.VortexConfig()
app = slithermodel.Application(uiConfig)
ui = mainwindow.ApplicationWindow(app)
app.loadPlugins()
logger.debug("Completed boot process")
_instance = ui
return ui
if __name__ == "__main__":
standalone()