-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature - add flags to leaderboard (#6509)
* add flags to leaderboard * remove conversion to list * switch csv to python file and clean up flag logic Co-authored-by: Dan Lipert <[email protected]> Co-authored-by: Aditya Anand M C <[email protected]>
- Loading branch information
1 parent
037aeab
commit 144365c
Showing
3 changed files
with
291 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
COUNTRY_DATA =[ | ||
"us","United States", | ||
"ad","Andorra", | ||
"ae","United Arab Emirates", | ||
"af","Afghanistan", | ||
"ag","Antigua and Barbuda", | ||
"ai","Anguilla", | ||
"ah","Artsakh", | ||
"ak","Abkhazia", | ||
"al","Albania", | ||
"am","Armenia", | ||
"an","Netherlands Antilles", | ||
"ao","Angola", | ||
"aq","Antarctica", | ||
"ar","Argentina", | ||
"as","American Samoa", | ||
"at","Austria", | ||
"au","Australia", | ||
"aw","Aruba", | ||
"ax","Åland Islands", | ||
"az","Azerbaijan", | ||
"ba","Bosnia and Herzegovina", | ||
"bb","Barbados", | ||
"bd","Bangladesh", | ||
"be","Belgium", | ||
"bf","Burkina Faso", | ||
"bg","Bulgaria", | ||
"bh","Bahrain", | ||
"bi","Burundi", | ||
"bj","Benin", | ||
"bl","Saint Barthélemy", | ||
"bm","Bermuda", | ||
"bn","Brunei Darussalam", | ||
"bo","Bolivia", | ||
"bq","Bonaire, Sint Eustatius and Saba", | ||
"br","Brazil", | ||
"bs","Bahamas", | ||
"bt","Bhutan", | ||
"bv","Bouvet Island", | ||
"bw","Botswana", | ||
"by","Belarus", | ||
"bz","Belize", | ||
"ca","Canada", | ||
"cc","Cocos (Keeling) Islands", | ||
"cd","Congo, The Democratic Republic Of The", | ||
"cf","Central African Republic", | ||
"cg","Congo", | ||
"ch","Switzerland", | ||
"ci","Côte D'Ivoire", | ||
"ck","Cook Islands", | ||
"cl","Chile", | ||
"cm","Cameroon", | ||
"cn","China", | ||
"co","Colombia", | ||
"cr","Costa Rica", | ||
"cu","Cuba", | ||
"cv","Cape Verde", | ||
"cw","Curaçao", | ||
"cx","Christmas Island", | ||
"cy","Cyprus", | ||
"cz","Czech Republic", | ||
"de","Germany", | ||
"dj","Djibouti", | ||
"dk","Denmark", | ||
"dm","Dominica", | ||
"do","Dominican Republic", | ||
"dz","Algeria", | ||
"ec","Ecuador", | ||
"ee","Estonia", | ||
"eg","Egypt", | ||
"eh","Western Sahara", | ||
"er","Eritrea", | ||
"es","Spain", | ||
"et","Ethiopia", | ||
"eu","Europe", | ||
"fi","Finland", | ||
"fj","Fiji", | ||
"fk","Falkland Islands (Malvinas)", | ||
"fm","Micronesia, Federated States Of", | ||
"fo","Faroe Islands", | ||
"fr","France", | ||
"ga","Gabon", | ||
"gb","United Kingdom", | ||
"gd","Grenada", | ||
"ge","Georgia", | ||
"gf","French Guiana", | ||
"gg","Guernsey", | ||
"gh","Ghana", | ||
"gi","Gibraltar", | ||
"gl","Greenland", | ||
"gm","Gambia", | ||
"gn","Guinea", | ||
"gp","Guadeloupe", | ||
"gq","Equatorial Guinea", | ||
"gr","Greece", | ||
"gs","South Georgia and the South Sandwich Islands", | ||
"gt","Guatemala", | ||
"gu","Guam", | ||
"gw","Guinea-Bissau", | ||
"gy","Guyana", | ||
"hk","Hong Kong", | ||
"hm","Heard and McDonald Islands", | ||
"hn","Honduras", | ||
"hr","Croatia", | ||
"ht","Haiti", | ||
"hu","Hungary", | ||
"ic","Canary Islands", | ||
"id","Indonesia", | ||
"ie","Ireland", | ||
"il","Israel", | ||
"im","Isle of Man", | ||
"in","India", | ||
"io","British Indian Ocean Territory", | ||
"iq","Iraq", | ||
"ir","Iran, Islamic Republic Of", | ||
"is","Iceland", | ||
"it","Italy", | ||
"je","Jersey", | ||
"jm","Jamaica", | ||
"jo","Jordan", | ||
"jp","Japan", | ||
"ke","Kenya", | ||
"kg","Kyrgyzstan", | ||
"kh","Cambodia", | ||
"ki","Kiribati", | ||
"km","Comoros", | ||
"kn","Saint Kitts And Nevis", | ||
"kp","Korea, Democratic People's Republic Of", | ||
"kr","Korea, Republic of", | ||
"kw","Kuwait", | ||
"ky","Cayman Islands", | ||
"kz","Kazakhstan", | ||
"la","Lao People's Democratic Republic", | ||
"lb","Lebanon", | ||
"lc","Saint Lucia", | ||
"li","Liechtenstein", | ||
"lk","Sri Lanka", | ||
"lr","Liberia", | ||
"ls","Lesotho", | ||
"lt","Lithuania", | ||
"lu","Luxembourg", | ||
"lv","Latvia", | ||
"ly","Libya", | ||
"ma","Morocco", | ||
"mc","Monaco", | ||
"md","Moldova, Republic of", | ||
"me","Montenegro", | ||
"mf","Saint Martin", | ||
"mg","Madagascar", | ||
"mh","Marshall Islands", | ||
"mk","Macedonia, the Former Yugoslav Republic Of", | ||
"ml","Mali", | ||
"mm","Myanmar", | ||
"mn","Mongolia", | ||
"mo","Macao", | ||
"mp","Northern Mariana Islands", | ||
"mq","Martinique", | ||
"mr","Mauritania", | ||
"ms","Montserrat", | ||
"mt","Malta", | ||
"mu","Mauritius", | ||
"mv","Maldives", | ||
"mw","Malawi", | ||
"mx","Mexico", | ||
"my","Malaysia", | ||
"mz","Mozambique", | ||
"na","Namibia", | ||
"nc","New Caledonia", | ||
"ne","Niger", | ||
"nf","Norfolk Island", | ||
"ng","Nigeria", | ||
"ni","Nicaragua", | ||
"nl","Netherlands", | ||
"no","Norway", | ||
"np","Nepal", | ||
"nr","Nauru", | ||
"nu","Niue", | ||
"ny","Northern Cyprus", | ||
"nz","New Zealand", | ||
"om","Oman", | ||
"pa","Panama", | ||
"pe","Peru", | ||
"pf","French Polynesia", | ||
"pg","Papua New Guinea", | ||
"ph","Philippines", | ||
"pk","Pakistan", | ||
"pl","Poland", | ||
"pm","Saint Pierre And Miquelon", | ||
"pn","Pitcairn", | ||
"pr","Puerto Rico", | ||
"ps","Palestine, State of", | ||
"pt","Portugal", | ||
"pw","Palau", | ||
"py","Paraguay", | ||
"qa","Qatar", | ||
"re","Réunion", | ||
"ro","Romania", | ||
"rs","Serbia", | ||
"ru","Russian Federation", | ||
"rw","Rwanda", | ||
"sa","Saudi Arabia", | ||
"sb","Solomon Islands", | ||
"sc","Seychelles", | ||
"sd","Sudan", | ||
"se","Sweden", | ||
"sg","Singapore", | ||
"sh","Saint Helena", | ||
"si","Slovenia", | ||
"sj","Svalbard And Jan Mayen", | ||
"sk","Slovakia", | ||
"sl","Sierra Leone", | ||
"sm","San Marino", | ||
"sn","Senegal", | ||
"so","Somalia", | ||
"sr","Suriname", | ||
"ss","South Sudan", | ||
"st","Sao Tome and Principe", | ||
"sv","El Salvador", | ||
"sx","Sint Maarten", | ||
"sy","Syrian Arab Republic", | ||
"sz","Swaziland", | ||
"tc","Turks and Caicos Islands", | ||
"td","Chad", | ||
"tf","French Southern Territories", | ||
"tg","Togo", | ||
"th","Thailand", | ||
"tj","Tajikistan", | ||
"tk","Tokelau", | ||
"tl","Timor-Leste", | ||
"tm","Turkmenistan", | ||
"tn","Tunisia", | ||
"to","Tonga", | ||
"tr","Turkey", | ||
"tt","Trinidad and Tobago", | ||
"tv","Tuvalu", | ||
"tw","Taiwan, Republic Of China", | ||
"tz","Tanzania, United Republic of", | ||
"ua","Ukraine", | ||
"ug","Uganda", | ||
"um","United States Minor Outlying Islands", | ||
"us","United States", | ||
"uy","Uruguay", | ||
"uz","Uzbekistan", | ||
"va","Holy See (Vatican City State)", | ||
"vc","Saint Vincent And The Grenadines", | ||
"ve","Venezuela, Bolivarian Republic of", | ||
"vg","Virgin Islands, British", | ||
"vi","Virgin Islands, U.S.", | ||
"vn","Vietnam", | ||
"vu","Vanuatu", | ||
"wf","Wallis and Futuna", | ||
"ws","Samoa", | ||
"xk","Kosovo", | ||
"ye","Yemen", | ||
"yt","Mayotte", | ||
"za","South Africa", | ||
"zm","Zambia", | ||
"zw","Zimbabwe", | ||
] | ||
|
||
|
||
FLAG_API_LINK = 'https://countryflags.io' | ||
|
||
FLAG_ERR_MSG = f'Failed to map country name, \ | ||
See {FLAG_API_LINK}/#countries \ | ||
for list of supported countries.' | ||
|
||
FLAG_SIZE = 32 # (32 | 64) | ||
FLAG_STYLE = 'flat' # (flat | shiny) | ||
|
||
COUNTRY_NAMES = COUNTRY_DATA[1::2] | ||
COUNTRY_CODES = COUNTRY_DATA[0::2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144365c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this tested? it broke https://gitcoin.co/leaderboard on everything BUT the countries list
https://bits.owocki.com/NQuDn1l6
putting in fix for 9aad3f0, but itll not display the flags now