#!/usr/bin/env python
-# weather version 1.3, http://fungi.yuggoth.org/weather/
-# Copyright (c) 2006 Jeremy Stanley <fungi@yuggoth.org>, 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 <fungi@yuggoth.org>.
+# 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
# 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)
+ )