Return date and not datetime
It does not have any sens to give a "time" for a daily forecast
This commit is contained in:
parent
aa491a8074
commit
5508f3a401
1 changed files with 2 additions and 2 deletions
|
|
@ -76,13 +76,13 @@ class YahooBackend(BaseBackend, ICapWeather):
|
||||||
def get_current(self, city_id):
|
def get_current(self, city_id):
|
||||||
dom = self._get_weather_dom(city_id)
|
dom = self._get_weather_dom(city_id)
|
||||||
current = dom.getElementsByTagName('yweather:condition')[0]
|
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')
|
float(current.getAttribute('temp')), unicode(current.getAttribute('text')), u'C')
|
||||||
|
|
||||||
def iter_forecast(self, city_id):
|
def iter_forecast(self, city_id):
|
||||||
dom = self._get_weather_dom(city_id)
|
dom = self._get_weather_dom(city_id)
|
||||||
for forecast in dom.getElementsByTagName('yweather:forecast'):
|
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('low')),
|
||||||
float(forecast.getAttribute('high')),
|
float(forecast.getAttribute('high')),
|
||||||
unicode(forecast.getAttribute('text')),
|
unicode(forecast.getAttribute('text')),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue