From 2416875ec0e4cf867b2f18b10652fd2274917b32 Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 30 Oct 2023 12:00:20 +0100 Subject: [PATCH 1/2] add stats about university --- parse.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/parse.py b/parse.py index 1892726..89ce7ea 100644 --- a/parse.py +++ b/parse.py @@ -26,6 +26,8 @@ BOOLEAN_IDS = ( 301, # Mörderspiel 311, # nur Rufname auf Badge ) +# where are U from? +UNI_ID = 300 def parse(filename: Union[str, Path]) -> Tuple[ @@ -136,6 +138,15 @@ def wiki_stats(items: Dict[int, str], count_items: Dict[int, int], questions: Di ret += f"|| {quest_titles[field]}: || {answer[1]} || {count}\n|-\n" ret += "|}\n\n" + unis = set() + for uni in quest_answers[UNI_ID]: + unis.add(uni[1].split()[-1]) + ret += (f'== anwesende Unis ==\n' + f'Insgesamt {len(unis)}. (Keine Garantie, dass diese automatisierte' + f' Erkennung sowie folgende Liste korrekt ist.)\n\n' + + ', '.join(sorted(unis)) + + '\n\n') + 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' From 5df2f840b2459ae1cc9484a2dd20cdbd01b6d989 Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 2 Nov 2023 14:48:27 +0100 Subject: [PATCH 2/2] more readable format for breakfast wishes --- parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.py b/parse.py index 89ce7ea..b97cd1c 100644 --- a/parse.py +++ b/parse.py @@ -124,7 +124,7 @@ def wiki_stats(items: Dict[int, str], count_items: Dict[int, int], questions: Di ret += '== Wünsche an das ewige Frühstück ==\n' for wish in quest_answers[BREAKFASTWISHES_ID]: - ret += f"*
{wish[1]}
\n" + ret += '* ' + wish[1].replace('\r\n', '
').replace('\n', '
') + '\n' ret += "\n" ret += ('== Checkbox-Abfragen ==\n'