-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
48 lines (40 loc) · 1.18 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
"""
Project Needle
Auburn University
Senior Design | Fall 2019
Team Members:
Andrea Walker, Rich Surgenor, Jackson Solley, Jacob Hagewood,
Justin Sutherland, Laura Grace Ayers.
"""
from gui import ui_main
import sys
import os
import platform
import time
if not platform.uname()[0] == 'Windows':
USING_PI = os.uname()[4][:3] == 'arm'
else:
USING_PI = False
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == 'forwarder':
if USING_PI:
print("Initializing with forwarding client (Pi)...")
import forwarding
fwder = forwarding.Forwarder()
while True:
if not fwder or fwder.closed:
if fwder:
del fwder
fwder = None
print("Attempting to recreate connection..")
try:
fwder = forwarding.Forwarder()
except Exception as e:
print("failed..")
time.sleep(2)
pass
else:
print("Initializing with forwarding server (PC)...")
ui_main(True)
else:
ui_main()