def get(self, id):
tourney = GetTourneyWithIdAndMaybeReturnStatus(self.response, id)
if not tourney:
return
if not CheckUserOwnsTournamentAndMaybeReturnStatus(self.response,
users.get_current_user(), tourney):
return
boards = ReadJSONInput(tourney.GetScoredHandList())
max_rounds = GetMaxRounds(boards)
summaries = Calculate(boards, max_rounds)
mp_summaries = summaries
ap_summaries = summaries
boards.sort(key=lambda bs : bs._board_no, reverse = False)
wb = WriteResultsToXlsx(max_rounds, mp_summaries, ap_summaries, boards,
name_list=self._GetPlayerListForTourney(tourney))
self.response.out.write(OutputWorkbookAsBytesIO(wb).getvalue())
self.response.headers['Content-Type'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
self.response.headers['Content-disposition'] = str('attachment; filename=' +
tourney.name + 'TournamentResults.xlsx')
self.response.headers['Content-Transfer-Encoding'] = 'Binary'
self.response.set_status(200)
评论列表
文章目录