#print data[i]['round'] + " " + data[i]['tournamentId'] self.storeData(data[i]['tournamentId'], data[i]['round']) print self._thisRound; def updateGames(self): sina = GamesFromSina() self.getGamesOfThisWeek() # After query, self._thisRound's value would like this: # {17: [17], 18: [16], 19: [18], 20: [16, 17], 21: [16]} keys = self._thisRound.keys() for i in range(len(keys)): tourId = keys[i] rounds = self._thisRound[keys[i]] for j in range(len(rounds)): leagueId = self._tourId2UrlId.get(tourId) if None != leagueId: print leagueId, rounds[j] sina.getRoundGames(leagueId, rounds[j]) sina.uploadRoundGames() if __name__ == "__main__": updater = UpdateSoccerGameTime() updater.updateGames() webApi = WebApi() webApi.updateParam('updateGameTime', '')
for i in range(len(data)): # print data[i]['round'] + " " + data[i]['tournamentId'] self.storeData(data[i]["tournamentId"], data[i]["round"]) print self._thisRound def updateGames(self): sina = GamesFromSina() self.getGamesOfThisWeek() # After query, self._thisRound's value would like this: # {17: [17], 18: [16], 19: [18], 20: [16, 17], 21: [16]} keys = self._thisRound.keys() for i in range(len(keys)): tourId = keys[i] rounds = self._thisRound[keys[i]] for j in range(len(rounds)): leagueId = self._tourId2UrlId.get(tourId) if None != leagueId: print leagueId, rounds[j] sina.getRoundGames(leagueId, rounds[j]) sina.uploadRoundGames() if __name__ == "__main__": updater = UpdateSoccerGameTime() updater.updateGames() webApi = WebApi() webApi.updateParam("updateGameTime", "")