X-Git-Url: https://www.yuggoth.org/gitweb?p=weather.git;a=blobdiff_plain;f=weather;fp=weather;h=5e620b8c39b70e6e110802e2bccd399bd4e6b291;hp=29ba2c3aaf9a23db731030fd6c7724597039d719;hb=8349654b7c627448b1e56c2943234895724d7857;hpb=eb249a0ae2f1644a67d6231b7cddf292058080e7 diff --git a/weather b/weather index 29ba2c3..5e620b8 100755 --- a/weather +++ b/weather @@ -1,16 +1,18 @@ #!/usr/bin/env python -# weather version 1.3, http://fungi.yuggoth.org/weather/ -# Copyright (c) 2006 Jeremy Stanley , all rights reserved. -# Licensed per terms in the LICENSE file distributed with this software. +# weather version 1.4, http://fungi.yuggoth.org/weather/ +# Copyright (c) 2006-2008 Jeremy Stanley . +# Permission to use, copy, modify, and distribute this software is +# granted under terms provided in the LICENSE file distributed with +# this software. """Wrapper utility using the weather.py module.""" # added so distributors can consistently specify a private module location private_module_path = None if private_module_path: - import sys - sys.path.insert(1, private_module_path) + import sys + sys.path.insert(1, private_module_path) import weather @@ -24,17 +26,22 @@ if get_bool("list"): print weather.list_aliases(selections.config) # normal operation else: - for argument in selections.arguments: - if get_bool("conditions", argument): - print weather.get_metar( - get("id", argument), - get_bool("verbose", argument) - ) - if not get_bool("conditions", argument) \ - or get_bool("forecast", argument): - print weather.get_forecast( - get("city", argument), - get("st", argument), - get_bool("verbose", argument) - ) - + for argument in selections.arguments: + if get_bool("conditions", argument): + print weather.get_metar( + id=get("id", argument), + verbose=get_bool("verbose", argument), + quiet=get_bool("quiet", argument), + headers=get("headers", argument), + murl=get("murl", argument) + ) + if not get_bool("conditions", argument) \ + or get_bool("forecast", argument): + print weather.get_forecast( + city=get("city", argument), + st=get("st", argument), + verbose=get_bool("verbose", argument), + quiet=get_bool("quiet", argument), + flines=get("flines", argument), + furl=get("furl", argument) + )