mirror of
https://github.com/chubin/wttr.in.git
synced 2025-08-17 17:11:42 +02:00
Check and observe region and country in building formatted location
This commit is contained in:
@@ -293,8 +293,8 @@ def location_processing(location, ip_addr):
|
|||||||
socket.gethostbyname(
|
socket.gethostbyname(
|
||||||
location.lstrip('~ ')[1:]))
|
location.lstrip('~ ')[1:]))
|
||||||
location = '~' + location
|
location = '~' + location
|
||||||
if country:
|
if region and country:
|
||||||
location += ", %s" % country
|
location += ", %s, %s" % (region, country)
|
||||||
hide_full_address = not force_show_full_address
|
hide_full_address = not force_show_full_address
|
||||||
except:
|
except:
|
||||||
location, region, country = NOT_FOUND_LOCATION, None, None
|
location, region, country = NOT_FOUND_LOCATION, None, None
|
||||||
@@ -318,7 +318,7 @@ def location_processing(location, ip_addr):
|
|||||||
# here too
|
# here too
|
||||||
if location:
|
if location:
|
||||||
location = '~' + location
|
location = '~' + location
|
||||||
if country:
|
if region and country:
|
||||||
location += ", %s, %s" % (region, country)
|
location += ", %s, %s" % (region, country)
|
||||||
hide_full_address = not force_show_full_address
|
hide_full_address = not force_show_full_address
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user