Weather: Strip trailing whitespace?

This commit is contained in:
James Lu 2014-11-29 22:54:53 -08:00
parent d77ac9a8e2
commit f5178e5aad
2 changed files with 4 additions and 4 deletions

View File

@ -250,10 +250,10 @@ class Weather(callbacks.Plugin):
except Exception as e: # rutroh. something went wrong.
self.log.info("_temp: ERROR trying to convert temp: {0} message: {1}".format(x, e))
return x
def _tw(self, bol, x):
"""This is a convenience handle that wraps _temp."""
# make sure we have 'bol', which should come in from args['nocolortemp'].
# since the option is a negation, we assume NO.
if not bol: # COLOR IT.
@ -618,7 +618,7 @@ class Weather(callbacks.Plugin):
outdata['windchill'] = self._tw(args['nocolortemp'], str(data['current_observation']['windchill_c']) + 'C')
outdata['feelslike'] = self._tw(args['nocolortemp'], str(data['current_observation']['feelslike_c']) + 'C')
outdata['visibility'] = str(data['current_observation']['visibility_km']) + 'km'
# handle forecast data part. output will be below. (not --forecast)
forecastdata = {} # key = int(day), value = forecast dict.
for forecastday in data['forecast']['txt_forecast']['forecastday']:

View File

@ -15,7 +15,7 @@ class WeatherTestCase(PluginTestCase):
PluginTestCase.setUp(self)
apiKey = os.environ.get('apiKey')
if not apiKey:
e = """The Wunderground API key has not been set.
e = """The Wunderground API key has not been set.
please set this value correctly and try again:
'export apiKey=<key>' for bash users"""
raise Exception(e)