]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Implement walkup_support conversion.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 23 Jan 2022 15:50:20 +0000 (16:50 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 23 Jan 2022 15:50:20 +0000 (16:50 +0100)
bots/sledrun_wikitext_to_json.py

index f71b19a181b7a0ed9a1f1c54001f9caaecb2f6d9..718b275479edc0fa64ed8dc02249423b0e832932 100644 (file)
@@ -159,6 +159,18 @@ class SledrunWikiTextToJsonBot(
             if v is not None:
                 sledrun_json['walkup_time'] = v
 
             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)
             v, w = rbb['Beleuchtungsanlage']
             if v is not None:
                 sledrun_json['nightlight_possible'] = tristate_german_to_str(v)