]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
location: Print country name if possible
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 19 May 2020 17:50:35 +0000 (17:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 19 May 2020 17:50:35 +0000 (17:50 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-query.in

index c13feb135c222d8724527ecba5b154e52a2b64d3..5f05b5cdb68327812131f3e6e6f93b3645be83c2 100644 (file)
@@ -292,7 +292,12 @@ class CLI(object):
 
                        # Print country
                        if network.country_code:
-                               print(format % (_("Country"), network.country_code))
+                               country = db.get_country(network.country_code)
+
+                               print(format % (
+                                       _("Country"),
+                                       country.name if country else network.country_code),
+                               )
 
                        # Print AS information
                        if network.asn: