Added support for official abbreviations

This commit is contained in:
2020-01-09 18:30:34 +01:00
parent 9e2dc083c6
commit 429ecf6ee0
2 changed files with 33 additions and 0 deletions

View File

@ -27,6 +27,7 @@ from selenium.webdriver.firefox import webdriver
from selenium.webdriver.firefox.options import Options
from twomartens.allrisscraper import meeting
from twomartens.allrisscraper import definitions
ALLRIS_LOGIN: str = "https://2martens.de/allris-eimsbüttel"
@ -140,6 +141,7 @@ def get_abbreviated_committee_name(name: str) -> str:
start_committee = "Sitzung des Ausschusses"
start_regional_committee = "Sitzung des Regionalausschusses"
start_plenary = "Sitzung der Bezirksversammlung"
start_youth_help_committee = "Sitzung des Jugendhilfeausschusses"
abbreviated_name = ""
if start_plenary in name:
abbreviated_name = "BV"
@ -153,6 +155,11 @@ def get_abbreviated_committee_name(name: str) -> str:
second_part = name[len(start_regional_committee):]
second_split = second_part.split(sep="/")
abbreviated_name = f"Ra{get_abbreviation(second_split)}"
elif start_youth_help_committee in name:
abbreviated_name = "JHA"
if abbreviated_name in definitions.ABBREVIATIONS["Eimsbüttel"]:
abbreviated_name = definitions.ABBREVIATIONS["Eimsbüttel"][abbreviated_name]
return abbreviated_name