]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Replace "comment" with "note" to make labeling more consistent.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 15 Mar 2022 22:28:48 +0000 (23:28 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 15 Mar 2022 22:30:14 +0000 (23:30 +0100)
bots/sledrun_wikitext_to_json.py
wrpylib/wrmwmarkup.py

index 72f28c1990c3d43b0618fc201b92f62e3102debc..39062968b285a1b8e5f14424893e04f4b026fe25 100644 (file)
@@ -140,7 +140,7 @@ class SledrunWikiTextToJsonBot(
             v, w = rbb['Aufstieg getrennt']
             if v is not None:
                 sledrun_json['walkup_separate'] = tristate_german_to_str(v)
-            optional_set(sledrun_json, 'walkup_comment', w)
+            optional_set(sledrun_json, 'walkup_note', w)
 
             optional_set(sledrun_json, 'walkup_time', rbb['Gehzeit'])
 
@@ -148,9 +148,9 @@ class SledrunWikiTextToJsonBot(
                 walkup_support_rbb = rbb['Aufstiegshilfe']
                 if walkup_support_rbb is not None:
                     walkup_supports = []
-                    for walkup_support_type, comment in walkup_support_rbb:
+                    for walkup_support_type, note in walkup_support_rbb:
                         walkup_support = {'type': walkup_support_type}
-                        optional_set(walkup_support, 'comment', comment)
+                        optional_set(walkup_support, 'note', note)
                         walkup_supports.append(walkup_support)
                     sledrun_json['walkup_supports'] = walkup_supports
             _walkup_support()
@@ -158,18 +158,18 @@ class SledrunWikiTextToJsonBot(
             v, w = rbb['Beleuchtungsanlage']
             if v is not None:
                 sledrun_json['nightlight_possible'] = tristate_german_to_str(v)
-            optional_set(sledrun_json, 'nightlight_possible_comment', w)
+            optional_set(sledrun_json, 'nightlight_possible_note', w)
 
             v, w = rbb['Beleuchtungstage']
             optional_set(sledrun_json, 'nightlight_weekdays_count', v)
-            optional_set(sledrun_json, 'nightlight_weekdays_comment', w)
+            optional_set(sledrun_json, 'nightlight_weekdays_note', w)
 
             def _sled_rental():
                 v = rbb['Rodelverleih']
                 if v is not None:
                     sledrun_json['sled_rental_direct'] = v != []
                     w = []
-                    for name, comment in v:
+                    for name, note in v:
                         x = {}
                         name_code = mwparserfromhell.parse(name)
                         wiki_link = next(name_code.ifilter_wikilinks(), None)
@@ -177,7 +177,7 @@ class SledrunWikiTextToJsonBot(
                             x['wr_page'] = wikilink_to_json(wiki_link)
                         else:
                             x['name'] = name
-                        optional_set(x, 'comment', comment)
+                        optional_set(x, 'note', note)
                         w.append(x)
                     sledrun_json['sled_rental'] = w
             _sled_rental()
index 7f302b5a1935d79e5ba5c481e0525e578ce11545..16893a2610a15235351640fd1e09e7aae4ddac76 100644 (file)
@@ -420,7 +420,7 @@ def create_sledrun_wiki(sledrun_json: Dict, map_json: Optional[Dict], impression
         ws = sledrun_json.get('walkup_supports')
         if ws is None:
             return None
-        return [(w['type'], w.get('comment')) for w in ws]
+        return [(w['type'], w.get('note')) for w in ws]
 
     def rodelverleih() -> Optional[List[Tuple[str, Optional[str]]]]:
         v = sledrun_json.get('sled_rental')
@@ -429,7 +429,7 @@ def create_sledrun_wiki(sledrun_json: Dict, map_json: Optional[Dict], impression
         w = []
         for x in v:
             n = x.get('name')
-            c = x.get('comment')
+            c = x.get('note')
             p = x.get('wr_page')
             if p is not None:
                 n = Jinja2Tools().json_wr_page(p)
@@ -481,9 +481,9 @@ def create_sledrun_wiki(sledrun_json: Dict, map_json: Optional[Dict], impression
         ('Gehzeit', sledrun_json.get('walkup_time')),
         ('Aufstiegshilfe', aufstiegshilfe()),
         ('Beleuchtungsanlage', (opt_tristate_german_from_str(sledrun_json.get('nightlight_possible', '')),
-                                sledrun_json.get('nightlight_possible_comment'))),
+                                sledrun_json.get('nightlight_possible_note'))),
         ('Beleuchtungstage', (sledrun_json.get('nightlight_weekdays_count'),
-                              sledrun_json.get('nightlight_weekdays_comment'))),
+                              sledrun_json.get('nightlight_weekdays_note'))),
         ('Rodelverleih', rodelverleih()),
         ('Gütesiegel', cachet()),
         ('Webauskunft', webauskunft()),