From: Philipp Spitzer Date: Tue, 15 Mar 2022 22:28:48 +0000 (+0100) Subject: Replace "comment" with "note" to make labeling more consistent. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/169d3d22da69aa7b2c18548f8a1ad5cddbb62d1e Replace "comment" with "note" to make labeling more consistent. --- diff --git a/bots/sledrun_wikitext_to_json.py b/bots/sledrun_wikitext_to_json.py index 72f28c1..3906296 100644 --- a/bots/sledrun_wikitext_to_json.py +++ b/bots/sledrun_wikitext_to_json.py @@ -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() diff --git a/wrpylib/wrmwmarkup.py b/wrpylib/wrmwmarkup.py index 7f302b5..16893a2 100644 --- a/wrpylib/wrmwmarkup.py +++ b/wrpylib/wrmwmarkup.py @@ -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()),