-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·32 lines (31 loc) · 860 Bytes
/
main.py
File metadata and controls
executable file
·32 lines (31 loc) · 860 Bytes
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
#! /bin/python3
import configparser
import sys
import os
import time
import configHandler
import httpServer
import websocketServer
import threading
import hidbackend
import scripts
if __name__ == '__main__':
path = sys.path[0]
os.chdir(path)
scripts.onStart()
configHandler.__init__()
wsthread=threading.Thread(target = websocketServer.run)
wsthread.daemon=True
print("Starting Websocket server")
wsthread.start()
print("Started Websocket server")
# websocketServer.run()
server = httpServer.Server(configHandler.config["server"])
httpthread=threading.Thread(target = server.serve_forever)
print("Starting HTTP server")
httpthread.start()
print("Started HTTP server")
ch9329_connected=False
while ch9329_connected==False:
ch9329_connected=hidbackend.init()
time.sleep(5)