Exemplo n.º 1
0
    def process_and_save_directions(self, route):
        """process and save directions"""

        # apply filters
        route = self.filter_directions(route)

        # add a fake destination step, so there is a "destination reached" message
        if route.point_count > 0:
            (lat, lon) = route.get_point_by_index(-1).getLL()
            dest_step = TurnByTurnPoint(lat, lon)
            dest_step.ssml_message = '<p xml:lang="en">you <b>should</b> be near the destination</p>'
            dest_step.description = 'you <b>should</b> be near the destination'
            dest_step.distance_from_start = route.length
            # TODO: make this multilingual
            # add it to the end of the message point list
            route.add_message_point(dest_step)

        # save
        self._directions = route