def add_visit(self, location: Location, staying_time, priority):
     """
     Adds a visit to a location specifying the details. If opening and closing are not specified, the location is open all the time
     :param location: Location to visit
     :param date_of_visit: Date of the visit (must be "YYYY-MM-DD" format)
     :param staying_time: Staying time of the visit (must be "hh:mm:ss" format)
     :param priority: A priority for scheduling this visit
     :param opening_time: Opening time of the location (must be "hh:mm:ss" format)
     :param closing_time: Closing time of the location (must be "hh:mm:ss" format)
     """
     date_of_visit = self.__date_of_itinerary()
     if location.is_closed(date_of_visit):
         return
     visit = {
         "name":
         location.name,
         "OpeningTime":
         date_of_visit + 'T' + location.opening_time(date_of_visit),
         "ClosingTime":
         date_of_visit + 'T' + location.closing_time(date_of_visit),
         "DwellTime":
         staying_time,
         "Priority":
         int(priority),
         "Location": {
             "Latitude": location.latitude,
             "Longitude": location.longitude
         }
     }
     self.__to_visit.append(visit)
     self.__modified = True
    def __parseFilterFile(self, filter):
        objectives = []
        goodPath = str(pathlib.Path(__file__).parent.parent.absolute()
                       ) + "\\Scrapping\\obiectiveData\\" + filter + ".txt"

        with open(goodPath.replace('\\', '/'), encoding="utf-8") as file:
            for line in file:
                data = line.strip().split(";")
                if len(data[-2]) == 0 or len(data[-3]) == 0:
                    continue
                try:
                    schedule = eval(data[-5])
                    if len(schedule) % 2 == 1:
                        continue
                    if 'hour' not in data[-4]:
                        continue
                    schedule = self.__build_schedule(schedule)
                except Exception as e:
                    # print(e)
                    continue
                nrs = re.findall(r'\d+', data[-4])
                if len(nrs) > 3 or len(nrs) == 0:
                    continue
                s = 0
                for nr in nrs:
                    s += int(nr)
                location = Location(data[0],
                                    float(data[-3]),
                                    float(data[-2]),
                                    schedule=schedule)
                if location.is_closed(self.__start_date_time.split("T")[0]):
                    continue
                objectives.append(
                    ObjectiveVisit(location, self.__nr_to_hour(s / len(nr)),
                                   None, data[1], data[3], data[5]))
        return objectives