From f5178e5aad3ffbb77e6742c2954ff74a32bd223a Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 29 Nov 2014 22:54:53 -0800 Subject: [PATCH] Weather: Strip trailing whitespace? --- plugin.py | 6 +++--- test.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index 7fc2434..d827d8a 100644 --- a/plugin.py +++ b/plugin.py @@ -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']: diff --git a/test.py b/test.py index 8672766..965658f 100644 --- a/test.py +++ b/test.py @@ -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=' for bash users""" raise Exception(e)