diff options
| author | 2019-06-30 10:41:25 +0100 | |
|---|---|---|
| committer | 2019-06-30 10:41:25 +0100 | |
| commit | 992f16a6857694e920f9d0d90aa87da4e8446764 (patch) | |
| tree | feb7302bc8b4c948de534c78831a36ca1c4e28e6 /modules | |
| parent | OptionsSetting ctor should have empty `options` when using options_factory (diff) | |
| signature | ||
Include `town` name, when available, in user `location` name
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/location.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/location.py b/modules/location.py index 84dcd691..0c795535 100644 --- a/modules/location.py +++ b/modules/location.py @@ -29,12 +29,9 @@ class Module(ModuleManager.BaseModule): name_parts = [] components = result["components"] - if "city" in components: - name_parts.append(components["city"]) - if "state" in components: - name_parts.append(components["state"]) - if "country" in components: - name_parts.append(components["country"]) + for part in ["town", "city", "state", "country"]: + if part in components: + name_parts.append(components[part]) if not name_parts: name_parts.append(result["formatted"]) |
