mirror of
https://github.com/chubin/wttr.in
synced 2024-11-15 00:27:09 +00:00
do not add country name to the GPS coords (fixes #260)
This commit is contained in:
parent
6dfd809694
commit
0f6d8da10c
1 changed files with 4 additions and 1 deletions
|
@ -243,7 +243,7 @@ def location_processing(location, ip_addr):
|
|||
# contains some unicode symbols
|
||||
# here we resolve them
|
||||
if location is not None and not ascii_only(location):
|
||||
location = "~" + location
|
||||
location = "~" + location.lstrip('~')
|
||||
|
||||
if location is not None and location.upper() in IATA_CODES:
|
||||
location = '~%s' % location
|
||||
|
@ -252,7 +252,10 @@ def location_processing(location, ip_addr):
|
|||
geolocation = geolocator(location_canonical_name(location[1:]))
|
||||
if geolocation is not None:
|
||||
override_location_name = location[1:].replace('+', ' ')
|
||||
if country:
|
||||
override_location_name += ", %s" % country
|
||||
location = "%s,%s" % (geolocation['latitude'], geolocation['longitude'])
|
||||
country = None
|
||||
if not hide_full_address:
|
||||
full_address = geolocation['address']
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue