From 1b39c3085e8cc36595bd4f4bd9d048a92b5e4d5f Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 2 Oct 2023 20:59:39 +0200 Subject: [PATCH] =?UTF-8?q?WIE=20HEI=E1=BA=9ET=20DAS=20DING=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parse.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/parse.py b/parse.py index 70d061b..01483a1 100644 --- a/parse.py +++ b/parse.py @@ -66,5 +66,18 @@ def wiki_stats(items: Dict[int, str], count_items: Dict[int, int], questions: Di for size, count in quest_answers[size_id].items(): ret += f"|| {questions[size_id]}: || {size[1]} || {count}\n|-\n" ret += "|}\n" + + athene_id = 305 # ID of the question how the logo image is to be named + human_id = 147 # ticket for a human + mascot_id = 148 # ticket for a mascot + def prefix(id_): + return "Mensch sagt:" if id_ == human_id else "Maskottchen sagt:" if id_ == mascot_id else "" + ret += ('== Wie heißt das Ding? ==\n' + '{|class="wikitable sortable"\n' + '! Variante !! Stimmen\n' + '|-\n') + for variant, count in quest_answers[athene_id].items(): + ret += f"|| {prefix(variant[0])} {variant[1]} || {count}\n|-\n" + ret += "|}\n" return ret