diff -Nru pywapi-0.3.7/CHANGELOG pywapi-0.3.8/CHANGELOG --- pywapi-0.3.7/CHANGELOG 2014-01-22 03:21:18.000000000 +0000 +++ pywapi-0.3.8/CHANGELOG 2014-02-14 23:38:20.000000000 +0000 @@ -1,3 +1,6 @@ +v0.3.8 (14 February 2014) +! Set all missing Weather.com XML tag values to an empty string + v0.3.7 (21 January 2014) ! Updated Weather.com URLs ! Better handling of Weather.com data when current daytime has passed diff -Nru pywapi-0.3.7/README pywapi-0.3.8/README --- pywapi-0.3.7/README 2014-01-22 03:28:22.000000000 +0000 +++ pywapi-0.3.8/README 2014-02-14 23:36:32.000000000 +0000 @@ -14,7 +14,7 @@ ==From source == -Download the latest pywapi library from: https://launchpad.net/python-weather-api/trunk/0.3.7/+download/pywapi-0.3.7.tar.gz +Download the latest pywapi library from: https://launchpad.net/python-weather-api/trunk/0.3.8/+download/pywapi-0.3.8.tar.gz Untar the source distribution and run: diff -Nru pywapi-0.3.7/debian/changelog pywapi-0.3.8/debian/changelog --- pywapi-0.3.7/debian/changelog 2014-02-05 03:00:58.000000000 +0000 +++ pywapi-0.3.8/debian/changelog 2014-02-14 23:44:33.000000000 +0000 @@ -1,3 +1,9 @@ +pywapi (0.3.8-0ubuntu0ppa1) saucy; urgency=low + + * New upstream release + + -- Joshua Tasker Fri, 14 Feb 2014 18:41:00 -0500 + pywapi (0.3.7-0ubuntu0ppa1) saucy; urgency=low * New upstream release diff -Nru pywapi-0.3.7/pywapi.py pywapi-0.3.8/pywapi.py --- pywapi-0.3.7/pywapi.py 2014-01-22 03:21:18.000000000 +0000 +++ pywapi-0.3.8/pywapi.py 2014-02-14 23:29:02.000000000 +0000 @@ -28,7 +28,7 @@ """ Fetches weather reports from Yahoo! Weather, Weather.com and NOAA """ -__version__ = "0.3.7" +__version__ = "0.3.8" try: # Python 3 imports @@ -182,8 +182,12 @@ weather_data[key] = {} for tag2 in list_of_tags2: key2 = key_map[tag2] - weather_data[key][key2] = weather_dom.getElementsByTagName( - tag)[0].getElementsByTagName(tag2)[0].firstChild.data + try: + weather_data[key][key2] = weather_dom.getElementsByTagName( + tag)[0].getElementsByTagName(tag2)[0].firstChild.data + except AttributeError: + # current tag has empty value + weather_data[key][key2] = unicode('') except IndexError: error_data = {'error': 'Error parsing Weather.com response. Full response: %s' % xml_response} return error_data @@ -195,8 +199,12 @@ weather_data['current_conditions'][key] = {} for tag2 in list_of_tags2: key2 = key_map[tag2] - weather_data['current_conditions'][key][key2] = cc_dom.getElementsByTagName( - tag)[0].getElementsByTagName(tag2)[0].firstChild.data + try: + weather_data['current_conditions'][key][key2] = cc_dom.getElementsByTagName( + tag)[0].getElementsByTagName(tag2)[0].firstChild.data + except AttributeError: + # current tag has empty value + weather_data['current_conditions'][key][key2] = unicode('') forecasts = [] if len(weather_dom.getElementsByTagName('dayf')) > 0: Binary files /tmp/6l9_Rkc74h/pywapi-0.3.7/pywapi.pyc and /tmp/p12zwjHteS/pywapi-0.3.8/pywapi.pyc differ