sort locations alphabetically

master
alice 3 years ago
parent bcfc9dda2f
commit 223f6b60bf

@ -43,6 +43,7 @@ def get_locations():
loc['country_name'] = countries_d.get(code, code) loc['country_name'] = countries_d.get(code, code)
loc['load_percent'] = ceil((loc['usage'].get('net', 0) / (loc['bandwidth'] / 1e6)) * 100) loc['load_percent'] = ceil((loc['usage'].get('net', 0) / (loc['bandwidth'] / 1e6)) * 100)
locations = list(sorted(locations, key=lambda l: l[0]))
return locations return locations

Loading…
Cancel
Save