-
Notifications
You must be signed in to change notification settings - Fork 2
/
navisat.py
46 lines (46 loc) · 1.6 KB
/
navisat.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
#!/usr/bin/python3
from core import config, above, helpmenu, categories, vpasses, rpasses
import os, pip
from fabulous import image
import requests, json
from configparser import ConfigParser
os.system("clear")
config.checkuser()
configuration = ConfigParser()
configuration.read("core/config.ini")
print(image.Image("images/sat.png"))
print("NaviSat | Satellite Info Tool".center(45, " "))
print("Developed by @maxbridgland".center(45, " "))
print("")
apiurl = "https://www.n2yo.com/rest/v1/satellite/"
apikey = configuration['DEFAULT']['apikey']
currentlat = configuration['DEFAULT']['currentlat']
currentlong = configuration['DEFAULT']['currentlong']
currentalt = configuration['DEFAULT']['currentalt']
pref = "[navisat]: "
helpmenu.displayhelp()
def main():
inpoot = input(pref)
if inpoot[0:6] == "search":
catid = categories.display()
print("Enter Search Radius (0-90)".center(45, " "))
sradius = input("> ")
above.run(apiurl, apikey, currentlat, currentlong, currentalt, sradius, catid)
main()
elif inpoot[0:7] == "vpasses":
vpasses.run(apiurl, apikey, currentlat, currentlong, currentalt)
main()
elif inpoot[0:7] == "rpasses":
rpasses.run(apiurl, apikey, currentlat, currentlong, currentalt)
main()
elif inpoot[0:5] == "reset":
os.system("rm -rf core/config.ini")
config.checkuser()
print("Restarting Program...")
os.system("./navisat.py")
elif inpoot[0:4] == "exit":
exit()
else:
print("Error Unknown Command...")
main()
main()