def getGame(userName, neverPlayed): if(priorUserInfo.userName == userName): if(neverPlayed == 1): randomGame = SteamAPI.getRandomUnplayedGame(priorUserInfo.unplayedGames) outputText.set(randomGame) gameData = GiantBombAPI.getGBData(randomGame) #if, else needed to make sure there was no error when getting the gameData if(GiantBombAPI.getLink(gameData) != 0): priorUserInfo.previousGameLink = GiantBombAPI.getLink(gameData) else: priorUserInfo.previousGameLink = "no" #if, else needed to make sure there was no error when getting gameData if (gameData != 0): GBgameInfo = GiantBombAPI.getMoreInfo(gameData) else: GBgameInfo = "No information could be found about this title. " elif(neverPlayed == 0): randomGame = SteamAPI.getRandomGame(priorUserInfo.Games) outputText.set(randomGame) gameData = GiantBombAPI.getGBData(randomGame) #if, else needed to make sure there was no error when getting the gameData if(GiantBombAPI.getLink(gameData) != 0): priorUserInfo.previousGameLink = GiantBombAPI.getLink(gameData) else: priorUserInfo.previousGameLink = "no" #if, else needed to make sure there was no error when getting gameData if (gameData != 0): GBgameInfo = GiantBombAPI.getMoreInfo(gameData) else: GBgameInfo = "No information could be found about this title. " else: Games = SteamAPI.getUsersGames(userName) priorUserInfo.Games = Games unplayedGames = SteamAPI.getUsersUnplayedGames(userName) priorUserInfo.unplayedGames = unplayedGames if(neverPlayed == 1): randomGame = SteamAPI.getRandomUnplayedGame(unplayedGames) outputText.set(randomGame) priorUserInfo.previousGame = randomGame gameData = GiantBombAPI.getGBData(randomGame) #if, else needed to make sure there was no error when getting the gameData if(GiantBombAPI.getLink(gameData) != 0): priorUserInfo.previousGameLink = GiantBombAPI.getLink(gameData) else: priorUserInfo.previousGameLink = "no" #if, else needed to make sure there was no error when getting gameData if (gameData != 0): GBgameInfo = GiantBombAPI.getMoreInfo(gameData) else: GBgameInfo = "No information could be found about this title. " elif(neverPlayed == 0): randomGame = SteamAPI.getRandomGame(Games) outputText.set(randomGame) gameData = GiantBombAPI.getGBData(randomGame) #if, else needed to make sure there was no error when getting the gameData if(GiantBombAPI.getLink(gameData) != 0): priorUserInfo.previousGameLink = GiantBombAPI.getLink(gameData) else: priorUserInfo.previousGameLink = "no" #if, else needed to make sure there was no error when getting gameData if (gameData != 0): GBgameInfo = GiantBombAPI.getMoreInfo(gameData) else: GBgameInfo = "No information could be found about this title. " infoBox.config(state=NORMAL) infoBox.insert(END, GBgameInfo) infoBox.insert(END, '\n\n') infoBox.see(END) infoBox.config(state=DISABLED) priorUserInfo.userName = userName