From 5508f3a4019304520a3afcb673fd5aac713ffda4 Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 27 Jan 2014 17:44:59 +0100 Subject: [PATCH] Return date and not datetime It does not have any sens to give a "time" for a daily forecast --- modules/yahoo/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/yahoo/backend.py b/modules/yahoo/backend.py index 0d020cb0..f56c614a 100644 --- a/modules/yahoo/backend.py +++ b/modules/yahoo/backend.py @@ -76,13 +76,13 @@ class YahooBackend(BaseBackend, ICapWeather): def get_current(self, city_id): dom = self._get_weather_dom(city_id) current = dom.getElementsByTagName('yweather:condition')[0] - return Current(parse_dt(current.getAttribute('date')), + return Current(parse_dt(current.getAttribute('date')).date(), float(current.getAttribute('temp')), unicode(current.getAttribute('text')), u'C') def iter_forecast(self, city_id): dom = self._get_weather_dom(city_id) for forecast in dom.getElementsByTagName('yweather:forecast'): - yield Forecast(parse_dt(forecast.getAttribute('date')), + yield Forecast(parse_dt(forecast.getAttribute('date')).date(), float(forecast.getAttribute('low')), float(forecast.getAttribute('high')), unicode(forecast.getAttribute('text')),