With yield instead of return a list
This commit is contained in:
parent
1b5c2f680d
commit
a4c8a1abf7
1 changed files with 1 additions and 3 deletions
|
|
@ -28,7 +28,6 @@ __all__ = ['ListPage', 'HistoryPage']
|
||||||
|
|
||||||
class ListPage(BasePage):
|
class ListPage(BasePage):
|
||||||
def get_rivers_list(self):
|
def get_rivers_list(self):
|
||||||
l = []
|
|
||||||
for pegel in self.document.getroot().xpath(".//a[@onmouseout='pegelaus()']"):
|
for pegel in self.document.getroot().xpath(".//a[@onmouseout='pegelaus()']"):
|
||||||
data = pegel.attrib['onmouseover'].strip('pegelein(').strip(')').replace(",'", ",").split("',")
|
data = pegel.attrib['onmouseover'].strip('pegelein(').strip(')').replace(",'", ",").split("',")
|
||||||
gauge = Gauge(int(data[7]))
|
gauge = Gauge(int(data[7]))
|
||||||
|
|
@ -56,8 +55,7 @@ class ListPage(BasePage):
|
||||||
else:
|
else:
|
||||||
gauge.forecast = NotAvailable
|
gauge.forecast = NotAvailable
|
||||||
|
|
||||||
l.append(gauge)
|
yield gauge
|
||||||
return l
|
|
||||||
|
|
||||||
|
|
||||||
class HistoryPage(BasePage):
|
class HistoryPage(BasePage):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue