[weboob] [PATCH 2/2] capabilities.weather.Current: fix default value for date

Matthieu Weber mweber+weboob at free.fr
Sun Feb 8 19:56:40 CET 2015


Signed-off-by: Matthieu Weber <mweber+weboob at free.fr>
---
 weboob/capabilities/weather.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/weboob/capabilities/weather.py b/weboob/capabilities/weather.py
index 4bc8f57..cb79ba2 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']
@@ -85,9 +85,9 @@ 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.date = date or None
         self.text = text
         self.temp = Temperature(temp, unit)
 
-- 
1.7.10.4



More information about the weboob mailing list