Changed the emoji parser from printing the entire list, but use the index value of the severity set in self.serverity. And removed a print in term_weather.

This commit is contained in:
2017-08-05 16:34:24 +02:00
parent 4a010a3f37
commit 115f62a7b3
2 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
# @Author: KevinMidboe # @Author: KevinMidboe
# @Date: 2017-07-29 11:56:24 # @Date: 2017-07-29 11:56:24
# @Last Modified by: KevinMidboe # @Last Modified by: KevinMidboe
# @Last Modified time: 2017-07-30 13:17:19 # @Last Modified time: 2017-08-05 16:32:44
from fuzzywuzzy import process from fuzzywuzzy import process
@@ -124,7 +124,7 @@ class EmojiParser(object):
forecast_emoji = self.emojify(forecast) forecast_emoji = self.emojify(forecast)
if forecast in severity: if forecast in severity:
return ('%s %s' % (forecast_emoji, severity[forecast])) return ('%s %s' % (forecast_emoji, severity[forecast][self.severity]))
else: else:
return forecast_emoji return forecast_emoji

4
term_forecast/term_weather.py Normal file → Executable file
View File

@@ -3,7 +3,7 @@
# @Author: KevinMidboe # @Author: KevinMidboe
# @Date: 2017-07-27 21:26:53 # @Date: 2017-07-27 21:26:53
# @Last Modified by: KevinMidboe # @Last Modified by: KevinMidboe
# @Last Modified time: 2017-07-30 19:56:18 # @Last Modified time: 2017-08-05 16:30:31
# TODO LIST # TODO LIST
# Get coordinates from IP ✔ # Get coordinates from IP ✔
@@ -108,7 +108,7 @@ class WeatherForecast(object):
class TermWeather(object): class TermWeather(object):
def __init__(self): def __init__(self):
print('here') pass
# Add now, forecast as args # Add now, forecast as args
def auto(self): def auto(self):