route_distances/distances.py
def distance(self, *args, **kwargs):
        """ Frontend function for self.route

        Wrapper function that sits between the end user and self.route, as
        defined by child classes. self.distance passes all arguments to
        self.route and handles retries.

        """

        exception = None

        for attempt in range(MAX_ATTEMPTS):
            try:
                if (attempt > 0):
                    self.log("Retrying (attempt %d)" % (attempt + 1))
                return self.route(*args, **kwargs)
            except Exception as error:
                exception = error
                print("Error: %s" % error)

        self.log("Max attempts reached (%d)" % MAX_ATTEMPTS)

        if (self.fail_fast):
            raise exception
        else:
            return False
 Frontend function for self.route

        Wrapper function that sits between the end user and self.route, as
        defined by child classes. self.distance passes all arguments to
        self.route and handles retries.

        
Frontend function for self.route
Wrapper function that sits between the end user and self.route, as
defined by child classes.
Frontend function for self . route Wrapper function that sits between the end user and self . route as defined by child classes .
def distance(self, *args, **kwargs):
        exception = None
        for attempt in range(MAX_ATTEMPTS):
            try:
                if (attempt > 0):
                    self.log("Retrying (attempt %d)" % (attempt + 1))
                return self.route(*args, **kwargs)
            except Exception as error:
                exception = error
                print("Error: %s" % error)
        self.log("Max attempts reached (%d)" % MAX_ATTEMPTS)
        if (self.fail_fast):
            raise exception
        else:
            return False
def distance ( self , * args , ** kwargs ) : exception = None for attempt in range ( MAX_ATTEMPTS ) : try : if ( attempt > 0 ) : self . log ( "Retrying (attempt %d)" % ( attempt + 1 ) ) return self . route ( * args , ** kwargs ) except Exception as error : exception = error print ( "Error: %s" % error ) self . log ( "Max attempts reached (%d)" % MAX_ATTEMPTS ) if ( self . fail_fast ) : raise exception else : return False
Frontend function for self.route
Wrapper function that sits between the end user and self.route, as
defined by child classes.
Frontend function for self . route Wrapper function that sits between the end user and self . route as defined by child classes .
""" Frontend function for self.route

        Wrapper function that sits between the end user and self.route, as
        defined by child classes. self.distance passes all arguments to
        self.route and handles retries.

        """
self