Make pep8 happy on sachsen module
This commit is contained in:
parent
09c4733e4b
commit
1ae1f23c85
3 changed files with 13 additions and 10 deletions
|
|
@ -50,11 +50,11 @@ class SachsenBrowser(BaseBrowser):
|
|||
return self.cache_list
|
||||
|
||||
def iter_history(self, id):
|
||||
self.location('/de/wu/umwelt/lfug/lfug-internet/hwz/MP/%d/index.html' %int(id))
|
||||
self.location('/de/wu/umwelt/lfug/lfug-internet/hwz/MP/%d/index.html' % int(id))
|
||||
return self.page.iter_history()
|
||||
|
||||
def last_seen(self, id):
|
||||
self.location('/de/wu/umwelt/lfug/lfug-internet/hwz/MP/%d/index.html' %int(id))
|
||||
self.location('/de/wu/umwelt/lfug/lfug-internet/hwz/MP/%d/index.html' % int(id))
|
||||
return self.page.last_seen()
|
||||
|
||||
def search(self, pattern):
|
||||
|
|
|
|||
|
|
@ -19,12 +19,13 @@
|
|||
|
||||
from datetime import datetime, date, time
|
||||
from weboob.tools.browser import BasePage
|
||||
|
||||
from weboob.capabilities.gauge import Gauge, GaugeMeasure
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
|
||||
|
||||
__all__ = ['ListPage', 'HistoryPage']
|
||||
|
||||
|
||||
class ListPage(BasePage):
|
||||
def get_rivers_list(self):
|
||||
l = []
|
||||
|
|
@ -58,6 +59,7 @@ class ListPage(BasePage):
|
|||
l.append(gauge)
|
||||
return l
|
||||
|
||||
|
||||
class HistoryPage(BasePage):
|
||||
def iter_history(self):
|
||||
table = self.document.getroot().cssselect('table[width="215"]')
|
||||
|
|
@ -85,13 +87,13 @@ class HistoryPage(BasePage):
|
|||
def first_value(self, table, index):
|
||||
first = NotAvailable
|
||||
for lignes in table[0].cssselect("tr"):
|
||||
try:
|
||||
valeur = float(lignes[index].text_content())
|
||||
if (valeur > 1.0):
|
||||
first = valeur
|
||||
return first
|
||||
except:
|
||||
continue
|
||||
try:
|
||||
valeur = float(lignes[index].text_content())
|
||||
if (valeur > 1.0):
|
||||
first = valeur
|
||||
return first
|
||||
except:
|
||||
continue
|
||||
return first
|
||||
|
||||
def last_seen(self):
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
from weboob.tools.test import BackendTest
|
||||
|
||||
|
||||
class SachsenTest(BackendTest):
|
||||
BACKEND = 'sachsen'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue