From 3e5856d02a2c969844405fb8ebd355b062d0da07 Mon Sep 17 00:00:00 2001 From: Matthieu Weber Date: Sun, 8 Feb 2015 20:56:40 +0200 Subject: [PATCH] capabilities.weather.Current: fix default value for date Signed-off-by: Matthieu Weber Signed-off-by: Romain Bignon --- weboob/capabilities/weather.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weboob/capabilities/weather.py b/weboob/capabilities/weather.py index 888cdb9a..ce121d17 100644 --- a/weboob/capabilities/weather.py +++ b/weboob/capabilities/weather.py @@ -21,7 +21,7 @@ from datetime import datetime, date from .base import Capability, BaseObject, Field, FloatField, \ - StringField, UserError + StringField, UserError, NotLoaded from .date import DateField __all__ = ['Forecast', 'Current', 'City', 'CityNotFound', 'Temperature', 'CapWeather'] @@ -32,8 +32,8 @@ class Temperature(BaseObject): value = FloatField('Temperature value') unit = StringField('Input unit') - def __init__(self, value='', unit = u''): - BaseObject.__init__(self, value) + def __init__(self, value=NotLoaded, unit = u''): + BaseObject.__init__(self, unicode(value)) self.value = value if unit not in [u'C', u'F']: unit = u'' @@ -69,7 +69,7 @@ class Forecast(BaseObject): high = Field('High temperature', Temperature) text = StringField('Comment on forecast') - def __init__(self, date='', low=None, high=None, text=None, unit=None): + def __init__(self, date=NotLoaded, low=None, high=None, text=None, unit=None): BaseObject.__init__(self, unicode(date)) self.date = date self.low = Temperature(low, unit) @@ -85,7 +85,7 @@ class Current(BaseObject): text = StringField('Comment about current weather') temp = Field('Current temperature', Temperature) - def __init__(self, date='', temp=None, text=None, unit=None): + def __init__(self, date=NotLoaded, temp=None, text=None, unit=None): BaseObject.__init__(self, unicode(date)) self.date = date self.text = text