-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.py
32 lines (24 loc) · 1011 Bytes
/
script.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
import os
import sys
from PyQt5.QtWidgets import QApplication
from qt_material import apply_stylesheet
from windows.Main import MainWindow
from windows.Login import LoginWindow
from subprocess import Popen, PIPE, STDOUT
# pyinstaller script.spec --hidden-import qt_material --hidden-import PyQt5
def resource_path(relative_path):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath('.'), relative_path)
if __name__ == '__main__':
if 'MotionFun' not in os.listdir('C:/'):
os.makedirs('C:/MotionFun')
app = QApplication(sys.argv)
apply_stylesheet(app, theme='dark_cyan.xml')
stylesheet = app.styleSheet()
with open(resource_path('assets/style.css')) as file:
app.setStyleSheet(stylesheet + file.read().format(**os.environ))
p = Popen('dmidecode.exe -s system-uuid', stdout=PIPE, stderr=STDOUT, shell=True)
sys_id = p.stdout.readline()
window = LoginWindow(sys_id)
app.exec()