This commit is contained in:
Auric Vente
2024-07-20 10:35:28 -06:00
parent 9aa043ad59
commit c2e2303f05
5 changed files with 271 additions and 2 deletions

View File

@@ -14,10 +14,12 @@ from .storage import Storage
class Utils:
names: ClassVar[list[str]] = []
countries: ClassVar[list[str]] = []
@staticmethod
def prepare() -> None:
Utils.names = Storage.get_names()
Utils.countries = Storage.get_countries()
@staticmethod
def now() -> float:
@@ -132,3 +134,8 @@ class Utils:
return "1 minute"
return f"{minutes} minutes"
@staticmethod
def random_country(ignore: list[str]) -> str:
filtered = [country for country in Utils.countries if country not in ignore]
return random.choice(filtered)