Include town
name, when available, in user location
name
This commit is contained in:
parent
cb07a5d708
commit
992f16a685
1 changed files with 3 additions and 6 deletions
|
@ -29,12 +29,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
name_parts = []
|
name_parts = []
|
||||||
components = result["components"]
|
components = result["components"]
|
||||||
if "city" in components:
|
for part in ["town", "city", "state", "country"]:
|
||||||
name_parts.append(components["city"])
|
if part in components:
|
||||||
if "state" in components:
|
name_parts.append(components[part])
|
||||||
name_parts.append(components["state"])
|
|
||||||
if "country" in components:
|
|
||||||
name_parts.append(components["country"])
|
|
||||||
|
|
||||||
if not name_parts:
|
if not name_parts:
|
||||||
name_parts.append(result["formatted"])
|
name_parts.append(result["formatted"])
|
||||||
|
|
Loading…
Reference in a new issue