mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
We want other pieces of country information (in particular the short names). This cleans up a lot of code anyway. As an added bonus, this now catches squadrons that used invalid names which would previously be passed through to pydcs and... then I don't know what would happen.
10 lines
275 B
Python
10 lines
275 B
Python
from dcs.countries import country_dict
|
|
from dcs.country import Country
|
|
|
|
|
|
def country_with_name(name: str) -> Country:
|
|
for country in country_dict.values():
|
|
if country.name == name:
|
|
return country()
|
|
raise KeyError(f"No country found named {name}")
|