]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/blobdiff - bots/update_sledrun_json_from_wikitext_see_also.py
Add script to remove unnecessary night light and sledrun rental descriptions.
[philipp/winterrodeln/wrpylib.git] / bots / update_sledrun_json_from_wikitext_see_also.py
index 4b2fdeaca93b88238cd30478ba51634f3cfd5349..c09e6a8de680f174be18c93d9f76cb8bcd6dc02f 100644 (file)
@@ -105,7 +105,7 @@ class UpdateSledrunJsonFromWikiText(
             wikicode_common = next(iter(wikicode.get_sections(levels=[2], matches='Allgemeines')), None)
             wikitext_common = str(wikicode_common)
             lines = wikitext_common.split('\n')
-            lines = dropwhile(lambda line: "'''Siehe auch'''" not in line, lines)
+            lines = dropwhile(lambda line: "'''Siehe auch'''" not in line and '* Siehe auch:' not in line, lines)
             lines = itertools.islice(lines, 1, None)  # omit "Siehe auch" line
             lines = takewhile(lambda line: line.startswith('**'), lines)
             for line in lines:
@@ -123,7 +123,7 @@ class UpdateSledrunJsonFromWikiText(
         if sledrun_json == sledrun_json_orig:
             return
         sledrun_json_text = json.dumps(sledrun_json_ordered, ensure_ascii=False, indent=4)
-        summary = 'Information zu "Anderen Rodelbahnen" im Rodelbahn JSON aktualisiert vom Wikitext.'
+        summary = 'Information zu "Siehe auch" im Rodelbahn JSON aktualisiert vom Wikitext.'
         self.userPut(sledrun_json_page, sledrun_json_orig_text, sledrun_json_text, summary=summary, contentmodel='json')