Beispiel #1
0
 def _get_directions_between_addresses_response(self, origin, destination,
                                                country, mode, units):
     origin = TextUtils.urlify(origin)
     destination = TextUtils.urlify(destination)
     url = GoogleMaps.DIRECTIONS.format(origin, destination, country, mode,
                                        units)
     return self._get_response_as_json(url)
Beispiel #2
0
 def _get_distance_between_addresses(self, origin, destination, country,
                                     mode, units):
     origin = TextUtils.urlify(origin)
     destination = TextUtils.urlify(destination)
     url = GoogleMaps.DISTANCE.format(origin, destination, country, mode,
                                      units)
     return self._get_response_as_json(url)
Beispiel #3
0
 def _get_directions_between_addresses_response(self, origin, destination, country, mode, units):
     origin = TextUtils.urlify(origin)
     destination = TextUtils.urlify(destination)
     url = GoogleMaps.DIRECTIONS.format(origin, destination, country, mode, units)
     return self._get_response_as_json(url)
Beispiel #4
0
 def _get_distance_between_addresses(self, origin, destination, country, mode, units):
     origin = TextUtils.urlify(origin)
     destination = TextUtils.urlify(destination)
     url = GoogleMaps.DISTANCE.format(origin, destination, country, mode, units)
     return self._get_response_as_json(url)
Beispiel #5
0
 def _get_latlong_for_location_response(self, location):
     location = TextUtils.urlify(location)
     url = GoogleMaps.GEOCODE.format(location)
     return self._get_response_as_json(url)
Beispiel #6
0
 def _get_latlong_for_location_response(self, location):
     location = TextUtils.urlify(location)
     url = GoogleMaps.GEOCODE.format(location)
     return self._get_response_as_json(url)
Beispiel #7
0
 def test_urlify(self):
     self.assertEquals("", TextUtils.urlify(""))
     self.assertEquals("%20", TextUtils.urlify(" "))
     self.assertEquals("Hello%20World", TextUtils.urlify("Hello World"))