Initial commit

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2020-05-03 22:01:00 +10:00
commit 6607890431
6 changed files with 43 additions and 0 deletions

8
aloftWxr.py Executable file
View file

@ -0,0 +1,8 @@
#! /usr/bin/python3
import pygrib
import sys
from config import config
conf = config()

35
config.py Normal file
View file

@ -0,0 +1,35 @@
import sys
import os
class config:
def __init__(self):
self.host = "localhost"
self.port = 1711
if os.name == 'nt': # If on windows
# TODO give windows path
pass
else:
self.tmpPath = "/tmp"
argc = len(sys.argv)
i = 1
while i < argc:
if sys.argv[i] == "-h" or sys.argv[i] == "--help":
print("Usage: aloftWxr.py [OPTIONS]")
print("Fetch live weather from NOAA servers and loads it into FlightGear")
print("OPTIONS")
print(" -h, --help Shows this help and exit")
print(" -f, --host FlightGear host. Default 'localhost'")
print(" -p, --port FLightGear port. Default 1711")
print(" -t, --tmp Directory for temporary files")
sys.exit(0)
elif sys.argv[i] == "-f" or sys.argv[i] == "--host":
i += 1
self.host = sys.argv[i]
elif sys.argv[i] == "-p" or sys.argv[i] == "--port":
i += 1
self.port = sys.argv[i]
elif sys.argv[i] == "-t" or sys.argv[i] == "--tmp":
i += 1
self.tmpPath = sys.argv[i]
i += 1

0
dataCycle.py Normal file
View file

0
fg.py Normal file
View file

0
functions.py Normal file
View file

0
wind.py Normal file
View file