Joins a list of locations into a pipe separated string, handling the various formats supported for lat/lng values. For example: p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"] convert.waypoint(p) # '-33.867486,151.206990|Sydney' :param arg: The lat/lng list. :t
(arg)
| 109 | |
| 110 | |
| 111 | def location_list(arg): |
| 112 | """Joins a list of locations into a pipe separated string, handling |
| 113 | the various formats supported for lat/lng values. |
| 114 | |
| 115 | For example: |
| 116 | p = [{"lat" : -33.867486, "lng" : 151.206990}, "Sydney"] |
| 117 | convert.waypoint(p) |
| 118 | # '-33.867486,151.206990|Sydney' |
| 119 | |
| 120 | :param arg: The lat/lng list. |
| 121 | :type arg: list |
| 122 | |
| 123 | :rtype: string |
| 124 | """ |
| 125 | if isinstance(arg, tuple): |
| 126 | # Handle the single-tuple lat/lng case. |
| 127 | return latlng(arg) |
| 128 | else: |
| 129 | return "|".join([latlng(location) for location in as_list(arg)]) |
| 130 | |
| 131 | |
| 132 | def join_list(sep, arg): |
no test coverage detected