diff options
author | Dan Winship <danw@src.gnome.org> | 2008-11-30 18:49:46 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2008-11-30 18:49:46 +0000 |
commit | 6736892bbacaa7bd6f9f710bb381444469ad2d7a (patch) | |
tree | 5014da246e09ae5274004eb64322d2f1c75b080e /data/update-locations.py | |
parent | c230d5aba8b43f950a8b450bac95d23c88e4afe9 (diff) | |
download | libgweather-6736892bbacaa7bd6f9f710bb381444469ad2d7a.tar.gz |
Fix the logic around assuming that cities are located in the same state as
* data/update-locations.py: Fix the logic around assuming that
cities are located in the same state as their weather station;
obviously this doesn't apply when they're in different countries.
Fixes a bug that previously caused Luxembourg (the city) to end up
in Belgium rather than Luxembourg (the country). #562772
svn path=/trunk/; revision=534
Diffstat (limited to 'data/update-locations.py')
-rw-r--r-- | data/update-locations.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/data/update-locations.py b/data/update-locations.py index 7088c5f..386e755 100644 --- a/data/update-locations.py +++ b/data/update-locations.py @@ -767,7 +767,8 @@ for id in cities: city.parent = fips_codes[city.state_code] else: for station in city.contents: - if station.code in station_states: + if station.country_code == city.country_code and \ + station.code in station_states: city.parent = station_states[station.code] break else: |