From 492cc0e63bfc73e4170d9bfe81b4e92f99818624 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 19 Mar 2014 17:04:49 +0100 Subject: [PATCH] Some cleaning --- modules/sachsen/backend.py | 3 --- modules/sachsen/browser.py | 3 +-- modules/sachsen/pages.py | 5 ++--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/sachsen/backend.py b/modules/sachsen/backend.py index 98c5e294..97b02573 100644 --- a/modules/sachsen/backend.py +++ b/modules/sachsen/backend.py @@ -17,9 +17,6 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - - - from .browser import SachsenBrowser from weboob.capabilities.gauge import ICapGauge, GaugeSensor, Gauge,\ SensorNotFound diff --git a/modules/sachsen/browser.py b/modules/sachsen/browser.py index b9cb9bb2..8e9c6d52 100644 --- a/modules/sachsen/browser.py +++ b/modules/sachsen/browser.py @@ -36,5 +36,4 @@ class SachsenBrowser(PagesBrowser): def iter_history(self, sensor, **kwargs): self.history.go(params=int(sensor.gaugeid)) - kwargs['sensor'] = sensor - return self.page.iter_history(**kwargs) + return self.page.iter_history(sensor=sensor) diff --git a/modules/sachsen/pages.py b/modules/sachsen/pages.py index 0ea4f16e..5b6eb080 100644 --- a/modules/sachsen/pages.py +++ b/modules/sachsen/pages.py @@ -39,7 +39,7 @@ class ListPage(HTMLPage): forecasts = {'pf_gerade.png': u'stable', 'pf_unten.png': u'Go down', 'pf_oben.png': u'Go up', - } + } alarmlevel = {"as1.gif": u"Alarmstufe 1", "as2.gif": u"Alarmstufe 2", "as3.gif": u"Alarmstufe 3", "as4.gig": u"Alarmstufe 4", "qua_grau.gif": u"No alarm function", "p_gruen.gif": u"", @@ -109,10 +109,9 @@ class HistoryPage(HTMLPage): def condition(self): return self.verif.match(self.el[0].text_content()) - obj_id = None obj_date = Date(Regexp(CleanText('.'), r'(\d+)\.(\d+)\.(\d+) (\d+):(\d+)', r'\3-\2-\1 \4:\5')) - sensor_types = [u'Level', u'Flow'] + def obj_level(self): index = self.sensor_types.index(self.env['sensor'].name) + 1 try: