Beispiel #1
0
	def updateBracket(self, xml):
		newUnfinishedMatches = []
		#xml should be the Match subtree
		for matchInfo in self.unfinishedMatches:
			print matchInfo.matchNumber
			matchData = obtainMatchFromXML(self, matchNumber, xmlDoc)
				if matchData.find('.Winner').text != NULL_PLAYER:
					print "Found!"
					matchInfo.winner = self.playerList[matchesXML.find('.Winner').text]
					matches.update(self.url, matchInfo.cID, scores_csv="2-0", winner_id=matchInfo.winner.cID) 
					break
Beispiel #2
0
			else:
				if roundNum < matchInfo.bracketRound:
					break
		return challongeArray, tioArray
	
	def updateBracket(self, xml):
		newUnfinishedMatches = []
		#xml should be the Match subtree
		for matchInfo in self.unfinishedMatches:
			print matchInfo.matchNumber
			matchData = obtainMatchFromXML(self, matchNumber, xmlDoc)
				if matchData.find('.Winner').text != NULL_PLAYER:
					print "Found!"
					matchInfo.winner = self.playerList[matchesXML.find('.Winner').text]
					matches.update(self.url, matchInfo.cID, scores_csv="2-0", winner_id=matchInfo.winner.cID) 
					break
		print "end"

	def obtainMatchFromXML(self, matchNumber, xmlDoc)
		for matchesXML in xml.findall('.Bracket/Matches/Match'):
				if matchesXML.find('.Number').text == matchInfo.matchNumber:
					return matchXML
		return None
		
	def updateWinnerToChallonge(self, matchData)
		if matchData.getWinner().challongeID == matchData.player1.challongeID:
			matches.update(self.challongeID, matchData.matchID, scores_csv='2-0', winner_id=matchData.getWinner().challongeID)
		else:
			matches.update(self.challongeID, matchData.matchID, scores_csv='0-2', winner_id=matchData.getWinner().challongeID)
		
		matchData.reported = True