Generate: split ERmain out of main (#3515)

This commit is contained in:
Fabian Dill
2024-06-16 03:27:06 +02:00
committed by GitHub
parent 2a11d610b6
commit e8542b8acd
3 changed files with 11 additions and 8 deletions

View File

@@ -26,6 +26,7 @@ def _generate_local_inner(games: Iterable[str],
with TemporaryDirectory() as players_dir:
with TemporaryDirectory() as output_dir:
import Generate
import Main
for n, game in enumerate(games, 1):
player_path = Path(players_dir) / f"{n}.yaml"
@@ -42,7 +43,7 @@ def _generate_local_inner(games: Iterable[str],
sys.argv = [sys.argv[0], "--seed", str(hash(tuple(games))),
"--player_files_path", players_dir,
"--outputpath", output_dir]
Generate.main()
Main.main(*Generate.main())
output_files = list(Path(output_dir).glob('*.zip'))
assert len(output_files) == 1
final_file = dest / output_files[0].name