Commit 5d4a84af authored by Laurent Bachelier's avatar Laurent Bachelier 🐧

ilmatieteenlaitos: Fix build with Python 3

Otherwise untested
parent 62b7339f
Pipeline #2786 passed with stages
in 7 minutes and 21 seconds
......@@ -18,13 +18,14 @@
# along with this weboob module. If not, see <>.
from datetime import date
from itertools import imap, ifilter
from weboob.browser.pages import JsonPage, HTMLPage
from six.moves import filter, map
from weboob.browser.elements import ItemElement, ListElement, method
from import Forecast, Current, City, Temperature
from weboob.browser.filters.json import Dict
from weboob.browser.filters.standard import Filter, CleanText
from weboob.browser.filters.standard import CleanText, Filter
from weboob.browser.pages import HTMLPage, JsonPage
from import City, Current, Forecast, Temperature
class Id(Filter):
......@@ -100,9 +101,9 @@ class WeatherPage(HTMLPage):
def info_for_value(value):
return CleanText(value % offset)(self).replace(u'edeltävän tunnin ', u'')
return ("klo %s: " % hour) + ", ".join(ifilter(bool, imap(info_for_value, values)))
return ("klo %s: " % hour) + ", ".join(filter(bool, map(info_for_value, values)))
return u'\n' + u'\n'.join(ifilter(bool, imap(descriptive_text_for_hour, ["02", "03", "14", "15"])))
return u'\n' + u'\n'.join(filter(bool, map(descriptive_text_for_hour, ["02", "03", "14", "15"])))
def get_station_id(self):
return CleanText(u'//select[@id="observation-station-menu"]/option[@selected="selected"]/@value')(self.doc)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment