Refactor code
This commit is contained in:
@ -65,8 +65,10 @@ class WeatherToFreemobile():
|
||||
#17649060-between-hours-of-12-midnight-and-7am-gmt-we-are-receiving
|
||||
#-the-wrong-data-for-most-locations
|
||||
if( abs(weather_date.date()-datetime.date.today())
|
||||
< datetime.timedelta(days=number_of_days)
|
||||
>= datetime.timedelta(days=number_of_days)
|
||||
):
|
||||
logging.info('Skipped {} (cf. API Bug)'.format(weather_date))
|
||||
else:
|
||||
temp = weather.get_temperature(unit='celsius')
|
||||
return_message.append(
|
||||
'{} : {} (min {}ºC, max {}ºC, rain:{}mm)'.format(
|
||||
@ -77,8 +79,6 @@ class WeatherToFreemobile():
|
||||
weather.get_rain().get('all',0)
|
||||
)
|
||||
)
|
||||
else:
|
||||
logging.info('Skipped {} (cf. API Bug)'.format(weather_date))
|
||||
|
||||
logging.info("Got the following weather: {}".format(return_message))
|
||||
return "\n".join(return_message)
|
||||
|
Reference in New Issue
Block a user