From: Philipp Spitzer Date: Sat, 21 May 2022 14:05:41 +0000 (+0200) Subject: Fix detecting entries under construction. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/9eff1ff7d7cd81ecc515d60817667d8410239501 Fix detecting entries under construction. --- diff --git a/bots/sledrun_wikitext_to_json.py b/bots/sledrun_wikitext_to_json.py index ddbc8eb..83590da 100644 --- a/bots/sledrun_wikitext_to_json.py +++ b/bots/sledrun_wikitext_to_json.py @@ -96,6 +96,9 @@ class SledrunWikiTextToJsonBot( sledrun_json_page = Page(self.site, self.current_page.title() + '/Rodelbahn.json') + if sledrun_json_page.exists(): # should be an option + return + map_json_page = Page(self.site, self.current_page.title() + '/Landkarte.json') map_json = None @@ -106,7 +109,7 @@ class SledrunWikiTextToJsonBot( sledrun_json = { "name": self.current_page.title(), "aliases": [], - "entry_under_construction": sum(1 for c in wikilink_list if c.text == 'Kategorie:In Arbeit') > 0, + "entry_under_construction": sum(1 for c in wikilink_list if c.title == 'Kategorie:In Arbeit') > 0, } optional_set(sledrun_json, 'description', get_sledrun_description(wikicode))