mirror of
https://github.com/chubin/wttr.in.git
synced 2024-10-05 01:42:07 +02:00
fixed lower case problem
This commit is contained in:
parent
c8341c5d84
commit
e78e6e6f22
@ -250,6 +250,8 @@ def location_processing(location, ip_addr):
|
||||
# here we resolve them
|
||||
if location is not None: # and not ascii_only(location):
|
||||
location = "~" + location.lstrip('~ ')
|
||||
if not override_location_name:
|
||||
override_location_name = location.lstrip('~')
|
||||
|
||||
# if location is not None and location.upper() in IATA_CODES:
|
||||
# location = '~%s' % location
|
||||
@ -257,7 +259,8 @@ def location_processing(location, ip_addr):
|
||||
if location is not None and location.startswith('~'):
|
||||
geolocation = geolocator(location_canonical_name(location[1:]))
|
||||
if geolocation is not None:
|
||||
override_location_name = location[1:].replace('+', ' ')
|
||||
if not override_location_name:
|
||||
override_location_name = location[1:].replace('+', ' ')
|
||||
location = "%s,%s" % (geolocation['latitude'], geolocation['longitude'])
|
||||
country = None
|
||||
if not hide_full_address:
|
||||
@ -267,6 +270,7 @@ def location_processing(location, ip_addr):
|
||||
else:
|
||||
location = NOT_FOUND_LOCATION #location[1:]
|
||||
|
||||
|
||||
return location, \
|
||||
override_location_name, \
|
||||
full_address, \
|
||||
|
Loading…
Reference in New Issue
Block a user