-
Notifications
You must be signed in to change notification settings - Fork 192
/
nut_gui.py
69 lines (49 loc) · 1.24 KB
/
nut_gui.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import threading
import urllib3
from PyQt5.QtGui import (QIcon)
from PyQt5.QtWidgets import (QApplication)
import nut
import Server
from gui.app import App
from nut import Usb
from nut import Hook
threadRun = True
def usbThread():
Usb.daemon()
def nutThread():
Server.run()
def initThread(app):
print('initThread start')
nut.scan()
app.refresh()
print('initThread finish')
def run():
urllib3.disable_warnings()
print(r' ,;:;;,')
print(r' ;;;;;')
print(r' .=\', ;:;;:,')
print(r' /_\', "=. \';:;:;')
print(r' @=:__, \,;:;:\'')
print(r' _(\.= ;:;;\'')
print(r' `"_( _/="`')
print(r' `"\'')
nut.initTitles()
nut.initFiles()
Hook.init()
app = QApplication(sys.argv)
app.setWindowIcon(QIcon('images/logo.jpg'))
ex = App()
threads = []
threads.append(threading.Thread(target=initThread, args=[ex]))
threads.append(threading.Thread(target=usbThread, args=[]))
threads.append(threading.Thread(target=nutThread, args=[]))
for t in threads:
t.start()
sys.exit(app.exec_())
print('fin')
if __name__ == '__main__':
run()
Hook.call("exit")