2
0
Fork 0

parse events containing 2 levels of location data

This commit is contained in:
Andreas (@xAndy) Zimmermann 2023-05-08 09:19:30 +02:00
parent 422d588d53
commit 8a8c415015
1 changed files with 7 additions and 1 deletions

View File

@ -38,7 +38,13 @@ def import_calendar(calendar):
if location: if location:
room = location room = location
try: try:
required_helpers = int(summary) try:
# new edge case: location is defined, but summary contains an addition to the location and a count
room2, required_helpers = tuple(summary.rsplit(maxsplit=1))
required_helpers = int(required_helpers)
room = f"{room} ({room2})"
except ValueError:
required_helpers = int(summary)
except ValueError: except ValueError:
required_helpers = 0 required_helpers = 0
else: else: