From: Philipp Spitzer Date: Sun, 23 Jan 2022 15:50:20 +0000 (+0100) Subject: Implement walkup_support conversion. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/7622f5be8f812223f5503a148a2eb00b5e7e5e11 Implement walkup_support conversion. --- diff --git a/bots/sledrun_wikitext_to_json.py b/bots/sledrun_wikitext_to_json.py index f71b19a..718b275 100644 --- a/bots/sledrun_wikitext_to_json.py +++ b/bots/sledrun_wikitext_to_json.py @@ -159,6 +159,18 @@ class SledrunWikiTextToJsonBot( if v is not None: sledrun_json['walkup_time'] = v + def _walkup_support(): + walkup_support_rbb = rbb['Aufstiegshilfe'] + if walkup_support_rbb is not None: + walkup_supports = [] + for walkup_support_type, comment in walkup_support_rbb: + walkup_support = {'type': walkup_support_type} + if comment is not None: + walkup_support['comment']: comment + walkup_supports.append(walkup_support) + sledrun_json['walkup_supports'] = walkup_supports + _walkup_support() + v, w = rbb['Beleuchtungsanlage'] if v is not None: sledrun_json['nightlight_possible'] = tristate_german_to_str(v)