Skip to content

Commit 57e4fe4

Browse files
committed
Use wikiReader in TagFix_Tree
1 parent 390eb75 commit 57e4fe4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/TagFix_Tree.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from modules.OsmoseTranslation import T_
2323
from plugins.Plugin import Plugin
2424
from modules.downloader import urlread
25+
from plugins.modules.wikiReader import read_wiki_table
2526

2627

2728
class TagFix_Tree(Plugin):
@@ -34,7 +35,7 @@ def _read_leaf_properties_table(self):
3435
allowed_leaf_cycle = ("evergreen", "deciduous")
3536

3637
data = urlread(u"https://wiki.openstreetmap.org/w/index.php?title=Tag:natural%3Dtree/List_of_Species&action=raw", 1)
37-
data = list(map(lambda x: list(filter(lambda z: len(z) > 0, map(lambda y: y.strip(), x.split("|")))), data.split("|-")[1:-1]))
38+
data = read_wiki_table(data)
3839
species_map = {}
3940
for row in data: # data: list of [species, species:wikidata, leaf_cycle, leaf_type]
4041
this_species = {}

0 commit comments

Comments
 (0)