From f7fc45b44d9ce028485c9de0467c68fcf55c17a8 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 11 Sep 2012 00:16:18 +0000 Subject: [PATCH] Make sure data files have final newlines. * weather.py(correlate): Previously the airports, places, stations, zctas and zones files lacked trailing newlines, so this trivial patch adds them before each is closed for writing. --- weather.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weather.py b/weather.py index dbf7f87..47870ec 100644 --- a/weather.py +++ b/weather.py @@ -1911,6 +1911,7 @@ def correlate(): for key, value in sorted( airports[airport].items() ): airports_fd.write( "\n%s = %s" % (key, value) ) count += 1 + airports_fd.write("\n") airports_fd.close() print("done (%s sections)." % count) message = "Writing %s..." % places_fn @@ -1926,6 +1927,7 @@ def correlate(): for key, value in sorted( places[fips].items() ): places_fd.write( "\n%s = %s" % (key, value) ) count += 1 + places_fd.write("\n") places_fd.close() print("done (%s sections)." % count) message = "Writing %s..." % stations_fn @@ -1941,6 +1943,7 @@ def correlate(): for key, value in sorted( stations[station].items() ): stations_fd.write( "\n%s = %s" % (key, value) ) count += 1 + stations_fd.write("\n") stations_fd.close() print("done (%s sections)." % count) message = "Writing %s..." % zctas_fn @@ -1956,6 +1959,7 @@ def correlate(): for key, value in sorted( zctas[zcta].items() ): zctas_fd.write( "\n%s = %s" % (key, value) ) count += 1 + zctas_fd.write("\n") zctas_fd.close() print("done (%s sections)." % count) message = "Writing %s..." % zones_fn @@ -1971,6 +1975,7 @@ def correlate(): for key, value in sorted( zones[zone].items() ): zones_fd.write( "\n%s = %s" % (key, value) ) count += 1 + zones_fd.write("\n") zones_fd.close() print("done (%s sections)." % count) message = "Starting QA check..." -- 2.11.0