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
|
return self.cache_list
|
||||||
|
|
||||||
def iter_history(self, id):
|
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()
|
return self.page.iter_history()
|
||||||
|
|
||||||
def last_seen(self, id):
|
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()
|
return self.page.last_seen()
|
||||||
|
|
||||||
def search(self, pattern):
|
def search(self, pattern):
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,13 @@
|
||||||
|
|
||||||
from datetime import datetime, date, time
|
from datetime import datetime, date, time
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
|
|
||||||
from weboob.capabilities.gauge import Gauge, GaugeMeasure
|
from weboob.capabilities.gauge import Gauge, GaugeMeasure
|
||||||
from weboob.capabilities.base import NotAvailable
|
from weboob.capabilities.base import NotAvailable
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['ListPage', 'HistoryPage']
|
__all__ = ['ListPage', 'HistoryPage']
|
||||||
|
|
||||||
|
|
||||||
class ListPage(BasePage):
|
class ListPage(BasePage):
|
||||||
def get_rivers_list(self):
|
def get_rivers_list(self):
|
||||||
l = []
|
l = []
|
||||||
|
|
@ -58,6 +59,7 @@ class ListPage(BasePage):
|
||||||
l.append(gauge)
|
l.append(gauge)
|
||||||
return l
|
return l
|
||||||
|
|
||||||
|
|
||||||
class HistoryPage(BasePage):
|
class HistoryPage(BasePage):
|
||||||
def iter_history(self):
|
def iter_history(self):
|
||||||
table = self.document.getroot().cssselect('table[width="215"]')
|
table = self.document.getroot().cssselect('table[width="215"]')
|
||||||
|
|
@ -85,13 +87,13 @@ class HistoryPage(BasePage):
|
||||||
def first_value(self, table, index):
|
def first_value(self, table, index):
|
||||||
first = NotAvailable
|
first = NotAvailable
|
||||||
for lignes in table[0].cssselect("tr"):
|
for lignes in table[0].cssselect("tr"):
|
||||||
try:
|
try:
|
||||||
valeur = float(lignes[index].text_content())
|
valeur = float(lignes[index].text_content())
|
||||||
if (valeur > 1.0):
|
if (valeur > 1.0):
|
||||||
first = valeur
|
first = valeur
|
||||||
return first
|
return first
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
return first
|
return first
|
||||||
|
|
||||||
def last_seen(self):
|
def last_seen(self):
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
from weboob.tools.test import BackendTest
|
from weboob.tools.test import BackendTest
|
||||||
|
|
||||||
|
|
||||||
class SachsenTest(BackendTest):
|
class SachsenTest(BackendTest):
|
||||||
BACKEND = 'sachsen'
|
BACKEND = 'sachsen'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue