diff --git a/stw_potsdam/xml_types/meal_xml.py b/stw_potsdam/xml_types/meal_xml.py index d9629a2..8e2218b 100644 --- a/stw_potsdam/xml_types/meal_xml.py +++ b/stw_potsdam/xml_types/meal_xml.py @@ -40,6 +40,8 @@ class MealXML: continue price = doc.createElement("price") price.setAttribute("role", key) + if val is None: + val = 0.0 txt_node = doc.createTextNode(f"{val:.2f}") price.appendChild(txt_node) meal.appendChild(price) diff --git a/stw_potsdam/xml_types/times_xml.py b/stw_potsdam/xml_types/times_xml.py index a458d13..3aaaa3d 100644 --- a/stw_potsdam/xml_types/times_xml.py +++ b/stw_potsdam/xml_types/times_xml.py @@ -15,8 +15,9 @@ class CanteenOpenTimespec(str): "", } - PATTERN = (r'.*(?P\d{1,2}):(?P\d{1,2})\s*' - r'-\s*(?P\d{1,2}):(?P\d{1,2}).*') + PATTERN = (r'.*(?P\d{1,2}):(?P\d{1,2})' + r'\D*(?P\d{1,2}):(?P\d{1,2}).*') + MATCHER = re.compile(PATTERN) def __new__(cls, spec):