Skip to content

Commit

Permalink
Merge pull request #472 from ZeusWPI/resto/teambuilding2023
Browse files Browse the repository at this point in the history
Add teambuilding & fix allergens
  • Loading branch information
niknetniko authored Sep 4, 2023
2 parents 7d5ca9b + 9ba70df commit a3cb411
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/scraper/resto/allergens.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ def parse_section_item(section_item: str) -> Union[dict[str, list[str]], None]:
"""
Parses strings of the form `food: allergen, allergen, allergen`
"""

item_name, item_allergen_list = section_item.split(":")

if "soep van de dag" in section_item:
item_name = "Soep van de dag"
item_allergen_list = section_item
else:
item_name, item_allergen_list = section_item.split(":")

# Sometimes a section will have extra info before the item list,
# this should not be parsed
Expand Down
26 changes: 26 additions & 0 deletions server/scraper/resto/menu_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,18 @@ def sterre_2023_hot(_path, original):
return original


def teambuilding_2023_nl(_path, original):
add_or_append(original, "Op 19 september zijn alle resto’s en cafetaria’s gesloten wegens teambuilding.")
original["open"] = False
return original


def teambuilding_2023_en(_path, original):
add_or_append(original, "On September 19th, all restaurants and cafeterias are closed due to teambuilding.")
original["open"] = False
return original


def create_changes(root_path):
return [
# Restjesmaand 2018
Expand Down Expand Up @@ -1283,6 +1295,20 @@ def create_changes(root_path):
end=date(2023, 8, 27),
all_days=True
),
ManualChange(
replacer=teambuilding_2023_nl,
resto=["nl-debrug", "nl-debrug-avond", "nl-dunant", "nl-coupure", "nl-sterre", "nl-ardoyen", "nl-merelbeke", "nl"],
start=date(2023, 9, 19),
end=date(2023, 9, 19),
all_days=True
),
ManualChange(
replacer=teambuilding_2023_en,
resto=["en"],
start=date(2023, 9, 19),
end=date(2023, 9, 19),
all_days=True
),
]


Expand Down

0 comments on commit a3cb411

Please sign in to comment.