X-Git-Url: https://www.yuggoth.org/gitweb?p=weather.git;a=blobdiff_plain;f=weather.py;h=2bacc27d6e602e58a3e5db9babc7f11b0f72a5b2;hp=cd22db37d8ac29570c028ae38c3439134b7db516;hb=ddf8f22fe8b8817a73ebf3af006c82138b46b322;hpb=ae2530c01c90d53d46e914f0577db91d8fc20acf diff --git a/weather.py b/weather.py index cd22db3..2bacc27 100644 --- a/weather.py +++ b/weather.py @@ -1,7 +1,7 @@ """Contains various object definitions needed by the weather utility.""" weather_copyright = """\ -# Copyright (c) 2006-2012 Jeremy Stanley . Permission to +# Copyright (c) 2006-2014 Jeremy Stanley . Permission to # use, copy, modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. #""" @@ -1226,7 +1226,7 @@ def correlate(): %s # generated by %s on %s from these public domain sources: # -# http://www.census.gov/geo/www/gazetteer/gazetteer2010.html +# http://www.census.gov/geo/maps-data/data/gazetteer2010.html # %s %s %s # %s %s %s # %s %s %s @@ -1545,12 +1545,12 @@ def correlate(): cpfz = {} cpfzcf = open(cpfzcf_fn) for line in cpfzcf: - fields = line.split("|") + fields = line.strip().split("|") if len(fields) == 11 \ and fields[0] and fields[1] and fields[9] and fields[10]: zone = "z".join( fields[:2] ).lower() if zone in zones: - zones[zone]["centroid"] = gecos( ",".join( fields[9:] ) ) + zones[zone]["centroid"] = gecos( ",".join( fields[9:11] ) ) elif fields[6]: state = fields[0] description = fields[3]