MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / render_game

Function render_game

codeclash/replay/serve.py:29–42  ·  view source on GitHub ↗
(game)

Source from the content-addressed store, hash-verified

27 """Serve the folder's replays until interrupted, opening the index in a browser."""
28
29 def render_game(game) -> str:
30 payload = {
31 "arena": tour.arena,
32 "players": tour.players,
33 "round": game.round,
34 "sim": game.sim,
35 "round_winner": game.winner if game.winner is not None else tour.round_winners.get(game.round),
36 "rounds": tour.rounds,
37 "sims": tour.sims_per_round,
38 "games": len(tour.games),
39 "folder": tour.folder.name,
40 "matchup": game.group or None,
41 }
42 return base.build_page(renderer.parse(base.read_sim(game), tour.players), payload, renderer)
43
44 def error_page(game, exc) -> str:
45 source = game.member or (game.path.name if game.path else "?")

Callers 1

do_GETMethod · 0.85

Calls 2

getMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected