]> git.ipfire.org Git - ipfire.org.git/blob - src/backend/countries.py
CSS: Add CSS for file listings
[ipfire.org.git] / src / backend / countries.py
1 #!/usr/bin/python
2
3 import iso3166
4
5 def get_name(code):
6 try:
7 return iso3166.countries_by_alpha2[code].name
8 except KeyError:
9 return code
10
11 def get_all(locale=None):
12 return sorted(iso3166.countries, key=lambda c: c.name)