From c5ee2aec2a6d3ea743754c6bd59a52f894a3ed59 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 30 Mar 2013 22:35:24 +0100 Subject: [PATCH] always call base constructor of CapBaseObject to prevent shared fields --- weboob/capabilities/weather.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/weboob/capabilities/weather.py b/weboob/capabilities/weather.py index 1252705b..582e9eaa 100644 --- a/weboob/capabilities/weather.py +++ b/weboob/capabilities/weather.py @@ -33,6 +33,7 @@ class Temperature(CapBaseObject): unit = StringField('Input unit') def __init__(self, value, unit = u''): + CapBaseObject.__init__(self, value) self.value = value if unit not in [u'C', u'F']: unit = u'' @@ -42,7 +43,7 @@ class Temperature(CapBaseObject): if not self.unit: return u'%s' % int(round(self.value)) elif self.unit == 'F': - return u'%sF' % int(round(self.value)) + return u'%s°F' % int(round(self.value)) else: return u'%s°F' % int(round((self.value * 9.0 / 5.0) + 32)) @@ -50,7 +51,7 @@ class Temperature(CapBaseObject): if not self.unit: return u'%s' % int(round(self.value)) elif self.unit == 'C': - return u'%sC' % int(round(self.value)) + return u'%s°C' % int(round(self.value)) else: return u'%s°C' % int(round((self.value - 32.0) * 5.0 / 9.0))