sane-weather: make the location configurable
This commit is contained in:
parent
5bf117fc05
commit
de09d54c64
|
@ -101,6 +101,12 @@ def main():
|
||||||
logging.basicConfig()
|
logging.basicConfig()
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="acquire weather information for user display")
|
parser = argparse.ArgumentParser(description="acquire weather information for user display")
|
||||||
|
parser.add_argument(
|
||||||
|
'--station-code',
|
||||||
|
default='KSEA',
|
||||||
|
help='4-letter METAR weather station code for where we want to know weather\n '
|
||||||
|
'to find your station see here: <https://aviationweather.gov/metar>'
|
||||||
|
)
|
||||||
parser.add_argument('--break-before', action='store_true', help='drop into a REPL before do anything (for debugging)')
|
parser.add_argument('--break-before', action='store_true', help='drop into a REPL before do anything (for debugging)')
|
||||||
parser.add_argument('--break-after', action='store_true', help='drop into a REPL after completing the work (for debugging)')
|
parser.add_argument('--break-after', action='store_true', help='drop into a REPL after completing the work (for debugging)')
|
||||||
parser.add_argument('--verbose', action='store_true', help='enable verbose logging')
|
parser.add_argument('--verbose', action='store_true', help='enable verbose logging')
|
||||||
|
@ -112,9 +118,7 @@ def main():
|
||||||
GLib.log_set_debug_enabled(True)
|
GLib.log_set_debug_enabled(True)
|
||||||
|
|
||||||
toplevel = TopLevel()
|
toplevel = TopLevel()
|
||||||
# for now, hardcoded; four-letter station code is that from METAR:
|
here = GWeather.Location.find_by_station_code(toplevel.source.world, args.station_code)
|
||||||
# - <https://aviationweather.gov/metar>
|
|
||||||
here = GWeather.Location.find_by_station_code(toplevel.source.world, 'KSEA')
|
|
||||||
|
|
||||||
if args.break_before:
|
if args.break_before:
|
||||||
code.interact(local=dict(**globals(), **locals()))
|
code.interact(local=dict(**globals(), **locals()))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user