Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't show gusts if they're zero.

  • Loading branch information...
commit 7d9382774a32a6358ae736f93c3e4e27dc482d02 1 parent 3f5fa7c
Dr. Drang authored
Showing with 6 additions and 2 deletions.
  1. +2 −1  weather.cgi
  2. +4 −1 weathertext
3  weather.cgi
View
@@ -86,7 +86,8 @@ content += '<p><img width="100%%" src="%s" /></p>\n' % radar
content += '<p id="now">Wind: %s at %s mph<br />' % (noaa['wind_dir'], noaa['wind_mph'] )
try:
- content += '<span id="gust">Gusting to %s mph</span><br />\n' % noaa['wind_gust_mph']
+ if float(noaa['wind_gust_mph']) > 0:
+ content += '<span id="gust">Gusting to %s mph</span><br />\n' % noaa['wind_gust_mph']
except KeyError:
pass
5 weathertext
View
@@ -49,7 +49,10 @@ out = []
out.append(u'Temperature: %.0f°' % float(noaa['temp_f']))
out.append(yahoo['condition']['text'])
try:
- gust = ', gusting to %s mph' % noaa['wind_gust_mph']
+ if float(noaa['wind_gust_mph']) > 0:
+ gust = ', gusting to %s mph' % noaa['wind_gust_mph']
+ else:
+ gust = ''
except KeyError:
gust = ''
out.append('Wind: %s at %s mph%s' % ( noaa['wind_dir'], noaa['wind_mph'], gust))
Please sign in to comment.
Something went wrong with that request. Please try again.