X-Git-Url: https://www.yuggoth.org/gitweb?p=weather.git;a=blobdiff_plain;f=weather.py;h=7d07e9134520b975270f3a1d4423683e1f3b9b8b;hp=5e5b16b8b8e5a679d1ab624953ccd2af0b81734b;hb=a33dd24ec1503c62f10587709e9b9a260972626b;hpb=e35fbc4d60478e82218b6364ecfd5480885e16fd diff --git a/weather.py b/weather.py index 5e5b16b..7d07e91 100644 --- a/weather.py +++ b/weather.py @@ -1,12 +1,12 @@ """Contains various object definitions needed by the weather utility.""" weather_copyright = """\ -# Copyright (c) 2006-2014 Jeremy Stanley . Permission to +# Copyright (c) 2006-2016 Jeremy Stanley . Permission to # use, copy, modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. #""" -weather_version = "2.0" +weather_version = "2.1" radian_to_km = 6372.795484 radian_to_mi = 3959.871528 @@ -692,6 +692,8 @@ def data_index(path): os.stat(candidate).st_mtime ) break + if filename in datafiles: + break return datafiles def guess( @@ -1196,14 +1198,14 @@ def correlate(): import codecs, datetime, hashlib, os, re, sys, tarfile, time, zipfile if pyversion("3"): import configparser else: import ConfigParser as configparser - gcounties_an = "2014_Gaz_counties_national.zip" - gcounties_fn = "2014_Gaz_counties_national.txt" - gcousubs_an = "2014_Gaz_cousubs_national.zip" - gcousubs_fn = "2014_Gaz_cousubs_national.txt" - gplace_an = "2014_Gaz_place_national.zip" - gplace_fn = "2014_Gaz_place_national.txt" - gzcta_an = "2014_Gaz_zcta_national.zip" - gzcta_fn = "2014_Gaz_zcta_national.txt" + gcounties_an = "2015_Gaz_counties_national.zip" + gcounties_fn = "2015_Gaz_counties_national.txt" + gcousubs_an = "2015_Gaz_cousubs_national.zip" + gcousubs_fn = "2015_Gaz_cousubs_national.txt" + gplace_an = "2015_Gaz_place_national.zip" + gplace_fn = "2015_Gaz_place_national.txt" + gzcta_an = "2015_Gaz_zcta_national.zip" + gzcta_fn = "2015_Gaz_zcta_national.txt" for filename in os.listdir("."): if re.match("bp[0-9][0-9][a-z][a-z][0-9][0-9].dbx$", filename): cpfzcf_fn = filename @@ -1226,7 +1228,7 @@ def correlate(): %s # generated by %s on %s from these public domain sources: # -# http://www.census.gov/geo/maps-data/data/gazetteer2014.html +# http://www.census.gov/geo/maps-data/data/gazetteer2015.html # %s %s %s # %s %s %s # %s %s %s @@ -1235,7 +1237,7 @@ def correlate(): # http://www.weather.gov/geodata/catalog/wsom/html/cntyzone.htm # %s %s %s # -# http://weather.noaa.gov/data/nsd_cccc.txt +# http://tgftp.nws.noaa.gov/data/nsd_cccc.txt # %s %s %s # # http://tgftp.nws.noaa.gov/data/zonecatalog.curr.tar