-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (24 loc) · 775 Bytes
/
main.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
from signal import SIGINT, SIGTERM, signal
from src.interface.mode import available_modes
from src.util import initialize_modes, initialize_sdks
def on_exit(*args):
print('\nShutting down program.')
for mode in available_modes:
mode.disable()
pass
signal(SIGINT, on_exit)
signal(SIGTERM, on_exit)
if __name__ == '__main__':
print("Program initiated!")
sdks = initialize_sdks()
sdk_list = []
for SDK in sdks:
sdk = SDK()
if not sdk.available():
continue
sdk_list.append(sdk)
modes = [mode(sdks=sdk_list,enable=False) for mode in initialize_modes()]
for mode in modes:
if 'Key' in mode.name:
mode.enable()
mode.start()