fix spaces in city name
This commit is contained in:
parent
914e86d567
commit
5a81f4d1fc
|
@ -22,6 +22,7 @@ import re
|
||||||
from extlib import irclib
|
from extlib import irclib
|
||||||
from extlib import pywapi
|
from extlib import pywapi
|
||||||
|
|
||||||
|
from urllib import quote
|
||||||
from urllib2 import URLError
|
from urllib2 import URLError
|
||||||
|
|
||||||
from Module import Module
|
from Module import Module
|
||||||
|
@ -35,7 +36,7 @@ class Weather(Module):
|
||||||
whats = what.split(' ')
|
whats = what.split(' ')
|
||||||
if whats[0] == "weather" and len(whats) >= 2:
|
if whats[0] == "weather" and len(whats) >= 2:
|
||||||
try:
|
try:
|
||||||
google_weather = pywapi.get_weather_from_google(''.join(whats[1:]))
|
google_weather = pywapi.get_weather_from_google(quote(' '.join(whats[1:])))
|
||||||
city = google_weather['forecast_information']['city'].encode('utf-8')
|
city = google_weather['forecast_information']['city'].encode('utf-8')
|
||||||
condition = google_weather['current_conditions']['condition'].encode('utf-8')
|
condition = google_weather['current_conditions']['condition'].encode('utf-8')
|
||||||
temp_f = google_weather['current_conditions']['temp_f'].encode('utf-8')
|
temp_f = google_weather['current_conditions']['temp_f'].encode('utf-8')
|
||||||
|
|
Loading…
Reference in New Issue