3 # weather version 1.2, http://fungi.yuggoth.org/weather/
4 # Copyright (c) 2006 Jeremy Stanley <fungi@yuggoth.org>, all rights reserved.
5 # Licensed per terms in the LICENSE file distributed with this software.
7 """Wrapper utility using the weather.py module."""
11 # initialize options and configs
12 selections = weather.Selections()
14 get_bool = selections.get_bool
16 # this mode just lists the aliases defined in the config
17 if get_bool("list"): print weather.list_aliases(selections.config)
21 for argument in selections.arguments:
22 if get_bool("conditions", argument):
23 print weather.get_metar(
25 get_bool("verbose", argument)
27 if not get_bool("conditions", argument) \
28 or get_bool("forecast", argument):
29 print weather.get_forecast(
30 get("city", argument),
32 get_bool("verbose", argument)