-
Notifications
You must be signed in to change notification settings - Fork 10
/
telebix.py
45 lines (34 loc) · 1.06 KB
/
telebix.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
from PyQt4 import QtCore, QtGui
from daemon import Daemon
import sys
import time
import jobs
def start_program():
app = QtGui.QApplication(sys.argv)
splash_pix = QtGui.QPixmap('resources/telebix_splash.png')
splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
splash.setWindowIcon(QtGui.QIcon('resources/icon.png'))
splash.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint)
splash.setEnabled(False)
Bar = QtGui.QProgressBar(splash)
Bar.setMaximum(10)
Bar.setGeometry(0, splash_pix.height() - 20, splash_pix.width(), 20)
splash.show()
for i in range(1, 11):
Bar.setValue(i)
t = time.time()
while time.time() < t + 0.2:
app.processEvents()
splash.close()
ui = jobs.App()
ui.plot_conf()
ui.init_button()
ui.show()
app.exec_()
class daemon_server(Daemon):
def run(self):
start_program()
daemon_service = daemon_server('/tmp/telebix.pid')
if __name__ == '__main__':
# start_program()
daemon_service.restart()