Exemplo n.º 1
0
    def load_seasons(self):
        with open('./data/seasons.json') as tData:
            data = json.load(tData)

            for season in data:
                # If the season does not yet exist, create it
                if(not season in self.get_seasons()):
                    self.seasons.update({ season: Season.Season(self.app, season, data[season]) })
Exemplo n.º 2
0
    def load_seasons(self):
        with open('./data/seasons.json') as tData:
            data = json.load(tData)

            for season in data:
                # If the season does not yet exist, create it
                if(not season in self.get_seasons()):
                    self.seasons.update({ season: Season.Season(self.app, season, data[season]) })

                    # Check how the user would like to load data
                    _season = self.get_season(season)
                    self.load_players(season)
                    self.load_ranking_points()
                    self.load_rounds(season)
                    self.load_tournaments(season)

                    # Execute the round mode (gen/load/overwrite)
                    if(season in self.round_mode):
                        if(callable(self.round_mode[season])):
                            self.round_mode[season]()
                            self.seasons[season]._j_data['settings'].update({ "loaded": True })
                        else:
                            # Let's go back to loading rounds
                            self.load_rounds(season, True, "The option you selected is unavailable.")