weather: update to 2.4.

This commit is contained in:
Andrew Benson 2020-06-22 15:50:54 -05:00 committed by Andrew Benson
parent b764992ce2
commit 0818bf55b2
3 changed files with 4 additions and 132 deletions

View file

@ -1,75 +0,0 @@
From 2a84a53f4aac0175f75b77e3a73d5a68b6e20ac6 Mon Sep 17 00:00:00 2001
From: Jeremy Stanley <fungi@yuggoth.org>
Date: Fri, 10 Mar 2017 15:13:31 +0000
Subject: [PATCH] Fix Py3K compatibility for compressed correlation
When run under Python 3.x, explicitly decode decompressed
bytestreams if reading pre-compressed correlation data files.
---
weather.py | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/weather.py b/weather.py
index b5b71a1..af43de4 100644
--- weather.py
+++ weather.py
@@ -744,7 +744,10 @@ def guess(
datafile = datafiles[dataname][0]
if datafile.endswith(".gz"):
import gzip
- stations.readfp( gzip.open(datafile) )
+ if pyversion("3"):
+ stations.read_string(
+ gzip.open(datafile).read().decode("utf-8") )
+ else: stations.readfp( gzip.open(datafile) )
else:
stations.read(datafile)
else:
@@ -760,7 +763,9 @@ def guess(
datafile = datafiles[dataname][0]
if datafile.endswith(".gz"):
import gzip
- zones.readfp( gzip.open(datafile) )
+ if pyversion("3"):
+ zones.read_string( gzip.open(datafile).read().decode("utf-8") )
+ else: zones.readfp( gzip.open(datafile) )
else:
zones.read(datafile)
else:
@@ -784,7 +789,10 @@ def guess(
datafile = datafiles[dataname][0]
if datafile.endswith(".gz"):
import gzip
- airports.readfp( gzip.open(datafile) )
+ if pyversion("3"):
+ airports.read_string(
+ gzip.open(datafile).read().decode("utf-8") )
+ else: airports.readfp( gzip.open(datafile) )
else:
airports.read(datafile)
else:
@@ -870,7 +878,10 @@ def guess(
datafile = datafiles[dataname][0]
if datafile.endswith(".gz"):
import gzip
- zctas.readfp( gzip.open(datafile) )
+ if pyversion("3"):
+ zctas.read_string(
+ gzip.open(datafile).read().decode("utf-8") )
+ else: zctas.readfp( gzip.open(datafile) )
else:
zctas.read(datafile)
else:
@@ -925,7 +936,10 @@ def guess(
datafile = datafiles[dataname][0]
if datafile.endswith(".gz"):
import gzip
- places.readfp( gzip.open(datafile) )
+ if pyversion("3"):
+ places.read_string(
+ gzip.open(datafile).read().decode("utf-8") )
+ else: places.readfp( gzip.open(datafile) )
else:
places.read(datafile)
else:

View file

@ -1,51 +0,0 @@
From 1ec2848c205249420d64d7924f2ee1840efff140 Mon Sep 17 00:00:00 2001
From: Jeremy Stanley <fungi@yuggoth.org>
Date: Sat, 16 Sep 2017 15:47:03 +0000
Subject: [PATCH] Add FAQ entry about --headers values
Be as clear as possible about what the --headers command-line option
or headers configuration option does, and what sorts of values are
valid for it.
---
FAQ | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/FAQ b/FAQ
index 1e0ff03..280c0af 100644
--- FAQ
+++ FAQ
@@ -2,7 +2,7 @@
Frequently Asked Questions About the Weather Utility
======================================================
-:Copyright: (c) 2006-2012 Jeremy Stanley <fungi@yuggoth.org>. Permission
+:Copyright: (c) 2006-2017 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.
@@ -54,3 +54,25 @@ As of the 2.0 release, this question is no longer relevant.
---------------------------------------------------------------
As of the 2.0 release, this is no longer necessary. See FAQ entries #2
and #3 for more detail.
+
+7. What values are valid for a --headers list?
+----------------------------------------------
+The default set it uses if you don't override it yourself on the command
+line or in configuration is as follows::
+
+ heat_index
+ precipitation_last_hour
+ relative_humidity
+ sky_conditions
+ temperature
+ weather
+ wind
+ windchill
+
+These are a case-insensitive match against the start of lines in a
+decoded METAR up to the first colon (:) with underscores (_) replaced by
+spaces. You can see the full METAR for a given condition report by
+passing --verbose or by observing one directly (perhaps by looking in
+your *datacache* directory). Unfortunately I haven't found any proper
+specification for the decoded METAR format used by the NWS so know of no
+comprehensive list of what lines might appear.

View file

@ -1,18 +1,16 @@
# Template file for 'weather' # Template file for 'weather'
pkgname=weather pkgname=weather
version=2.3 version=2.4
revision=3 revision=1
archs=noarch archs=noarch
hostmakedepends="python3"
depends="python3" depends="python3"
pycompile_module="weather.py"
conf_files="/etc/weatherrc" conf_files="/etc/weatherrc"
short_desc="A CLI utility for current (METAR) weather conditions and forecasts" short_desc="CLI utility for current (METAR) weather conditions and forecasts"
maintainer="Richard Taityr <dicktyr@yahoo.co.uk>" maintainer="Richard Taityr <dicktyr@yahoo.co.uk>"
license="ISC" license="ISC"
homepage="http://fungi.yuggoth.org/weather/" homepage="http://fungi.yuggoth.org/weather/"
distfiles="http://fungi.yuggoth.org/${pkgname}/src/${pkgname}-${version}.tar.xz" distfiles="http://fungi.yuggoth.org/${pkgname}/src/${pkgname}-${version}.tar.xz"
checksum=86148d2f1d59867f637f52558cc2a6b3280fac94df55c6e5af0ce37cc190d146 checksum=6a5bac6110922b584ee635ddfce7594f8a3fea6b0b2763435bd641f6c9a4c420
do_install() { do_install() {
vbin weather vbin weather