commit 66078904318ce51b2dc23301f7c5b98056f2bb6f Author: fly Date: Sun May 3 22:01:00 2020 +1000 Initial commit Signed-off-by: fly diff --git a/aloftWxr.py b/aloftWxr.py new file mode 100755 index 0000000..08f3bde --- /dev/null +++ b/aloftWxr.py @@ -0,0 +1,8 @@ +#! /usr/bin/python3 + +import pygrib +import sys + +from config import config + +conf = config() diff --git a/config.py b/config.py new file mode 100644 index 0000000..022e63e --- /dev/null +++ b/config.py @@ -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 diff --git a/dataCycle.py b/dataCycle.py new file mode 100644 index 0000000..e69de29 diff --git a/fg.py b/fg.py new file mode 100644 index 0000000..e69de29 diff --git a/functions.py b/functions.py new file mode 100644 index 0000000..e69de29 diff --git a/wind.py b/wind.py new file mode 100644 index 0000000..e69de29