コード例 #1
0
    def __init__(self, value):
        """
        @param value to parse
        """
        self.value = clean_value(value)
        self.is_always_open = False
        if self.value == "24/7":
            self.is_always_open = True
            return  # can't parse this value atm

        try:
            self.opening_hours = parse_string(self.value)
        except Exception as e:
            raise ParseException(value, e)
コード例 #2
0
 def __init__(self, value):
     """
     @param value to parse
     """
     self.value = clean_value(value)
     self.is_always_open = False
     if self.value == "24/7":
         self.is_always_open = True
         return    # can't parse this value atm
     
     try:
         self.opening_hours = parse_string(self.value)
     except Exception as e:
         raise ParseException(value, e)
コード例 #3
0
 def test_clean_value(self):
     self.assertEqual(clean_value("Mo-Fr 08:30-22:00; "), "mo-fr 08:30-22:00")
コード例 #4
0
 def test_clean_value(self):
     self.assertEqual(clean_value("Mo-Fr 08:30-22:00; "),
                      "mo-fr 08:30-22:00")