Return date and not datetime

It does not have any sens to give a "time" for a daily forecast
This commit is contained in:
Florent 2014-01-27 17:44:59 +01:00
commit 5508f3a401

View file

@ -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')),