From: Philipp Spitzer Date: Sun, 12 Dec 2021 15:39:44 +0000 (+0100) Subject: Parse car_parking. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/75d2d43dadc6b530113fcee055dc68ee8ba6dde3 Parse car_parking. --- diff --git a/bots/sledrun_wikitext_to_json.py b/bots/sledrun_wikitext_to_json.py index e2a6c53..8827f2b 100644 --- a/bots/sledrun_wikitext_to_json.py +++ b/bots/sledrun_wikitext_to_json.py @@ -241,7 +241,15 @@ class SledrunWikiTextToJsonBot( if x: sledrun_json["car_description"] = str(x) break - break + x = [] + for w in v.ifilter_templates(matches='Parkplatz'): + za = str_or_none(w.get(1, None)) + zb = str_or_none(w.get(2, None)) + z = lonlat_ele_to_json(opt_lonlat_from_str(za), opt_uint_from_str(zb)) + if len(z) > 0: + x.append({'position': z}) + if len(x) > 0: + sledrun_json['car_parking'] = x x = [] for v in wikicode.get_sections(levels=[2], matches='Allgemeines'):