Merge branch 'main' into breaking_changes

# Conflicts:
#	Main.py
#	Utils.py
This commit is contained in:
Fabian Dill
2021-03-07 22:04:06 +01:00
9 changed files with 142 additions and 72 deletions

View File

@@ -52,7 +52,10 @@ def snes_to_pc(value):
def parse_player_names(names, players, teams):
names = tuple(n for n in (n.strip() for n in names.split(",")) if n)
if len(names) != len(set(names)):
raise ValueError("Duplicate Player names is not supported.")
import collections
name_counter = collections.Counter(names)
raise ValueError(f"Duplicate Player names is not supported, "
f'found multiple "{name_counter.most_common(1)[0][0]}".')
ret = []
while names or len(ret) < teams:
team = [n[:16] for n in names[:players]]