]> jfr.im git - erebus.git/blobdiff - modules/weather.py
help - fix help_nolag
[erebus.git] / modules / weather.py
index 0a3ce3b724576a4d8223f6a13a40cb2140d8a181..6b507713f26cb351877fb04768df7ab6e8afe161 100644 (file)
@@ -37,7 +37,7 @@ def _weather(place):
                measuredat = rfc822.parsedate(current['observation_time_rfc822']) # parsedate_tz returns a 10-tuple which strftime DOESN'T ACCEPT
                measuredatTZ = current['local_tz_short']
                loc = current['observation_location']
-               if loc['city'] == "": loc = current['display_location']
+               if loc['city'] == "" or loc['state'] == "": loc = current['display_location']
                return u"Weather in %(location)s: As of %(time)s %(tz)s, %(conditions)s, %(cel)s\u00B0C (%(far)s\u00B0F) (feels like %(flcel)s\u00B0C (%(flfar)s\u00B0F)). Wind %(wind)s. %(link)s" % {
                        'location': loc['full'],
                        'time': time.strftime("%a %H:%M", measuredat), 'tz': measuredatTZ,
@@ -48,7 +48,7 @@ def _weather(place):
                        'link': current['forecast_url'],
                }
        else:
-               return "I don't know where to look! Try %sSETINFO LOCATION <your location>" % (bot.parent.trigger)
+               return "I don't know where to look! Try %sSETINFO LOCATION <your location>" % (lib.parent.trigger)
 
 @lib.hook(('weather','w'), needchan=False, wantchan=True)
 @lib.help('[<location>]', 'show weather for your location')