def generate_stage(self, i, stage): if i == 0: return tournament.create_group_stage_section(stage) if i == 1: svg = playoffs_svg.create_single_elimination_svg(stage['matches']) image = tournament.svg_to_image(svg, alt="") return tournament.create_knockout_stage_section(stage, image=image)
def generate_stage(self, i, stage): if i in (0, 2): return tournament.create_bo3_group_stage_section(stage) if i in (1, 3): svg = playoffs_svg.create_gauntlet_svg(stage['matches']) image = tournament.svg_to_image(svg, alt="") return tournament.create_knockout_stage_section(stage, image=image) if i == 4: return tournament.create_championship_points_section(stage) if i == 5: svg = playoffs_svg.create_single_elimination_svg(stage['matches']) image = tournament.svg_to_image(svg, alt="") return tournament.create_knockout_stage_section(stage, image=image)