def __build_excluded_areas(self, mapping_manager: MappingManager): self.__excluded_areas: List[GeofenceHelper] = [] if self.__args.webhook_excluded_areas == "": pass tmp_excluded_areas = {} for rm in mapping_manager.get_all_routemanager_names(): name = mapping_manager.routemanager_get_name(rm) gfh = mapping_manager.routemanager_get_geofence_helper(rm) tmp_excluded_areas[name] = gfh area_names = self.__args.webhook_excluded_areas.split(",") for area_name in area_names: area_name = area_name.strip() for name, gf in tmp_excluded_areas.items(): if (area_name.endswith("*") and name.startswith( area_name[:-1])) or area_name == name: self.__excluded_areas.append(gf) tmp_excluded_areas = None if len(self.__excluded_areas) > 0: logger.info("Excluding {} areas from webhooks", len(self.__excluded_areas))
def __build_ivmon_list(self, mapping_manager: MappingManager): self.__IV_MON: List[int] = [] for routemanager_name in mapping_manager.get_all_routemanager_names(): ids_iv_list: Optional[List[int]] = mapping_manager.routemanager_get_ids_iv(routemanager_name) if ids_iv_list is not None: # TODO check if area/routemanager is actually active before adding the IDs self.__IV_MON = self.__IV_MON + list(set(ids_iv_list) - set(self.__IV_MON))