(self)
This function take the wildcard data from the API and turn them into objects.
            TODO:
                the way I wrote this function is not pythonic at all (but works). Need to rewrite this part.
This function take the wildcard data from the API and turn them into objects.
            TODO:
                the way I wrote this function is not pythonic at all (but works). Need to rewrite this part.
This function take the wildcard data from the API and turn them into objects . TODO : the way I wrote this function is not pythonic at all ( but works ) . Need to rewrite this part .
def get_wild_card(self):
        """
            This function take the wildcard data from the API and turn them into objects.
            TODO:
                the way I wrote this function is not pythonic at all (but works). Need to rewrite this part.
        """
        conferences_data = self.data_wildcard
        eastern = []
        western = []
        for conference in conferences_data:
            """ Reset variables """
            metropolitan = []
            atlantic = []
            central = []
            pacific = []
            wild_card = []
            for record in conferences_data[conference]:
                if record['standingsType'] == "wildCard":
                    wild_card = record['teamRecords']
                elif record['standingsType'] == "divisionLeaders":
                    if record['division']['name'] == "Metropolitan":
                        metropolitan = record
                    elif record['division']['name'] == "Atlantic":
                        atlantic = record
                    elif record['division']['name'] == "Central":
                        central = record
                    elif record['division']['name'] == "Pacific":
                        pacific = record

            division = nhl_api.info.Division(metropolitan, atlantic, central, pacific)

            if conference == 'eastern' and wild_card and division:
                eastern = nhl_api.info.Wildcard(wild_card, division)
            elif conference == 'western':
                western = nhl_api.info.Wildcard(wild_card, division)

        self.by_wildcard = nhl_api.info.Conference(eastern, western)
def get_wild_card ( self ) : conferences_data = self . data_wildcard eastern = [ ] western = [ ] for conference in conferences_data : """ Reset variables """ metropolitan = [ ] atlantic = [ ] central = [ ] pacific = [ ] wild_card = [ ] for record in conferences_data [ conference ] : if record [ 'standingsType' ] == "wildCard" : wild_card = record [ 'teamRecords' ] elif record [ 'standingsType' ] == "divisionLeaders" : if record [ 'division' ] [ 'name' ] == "Metropolitan" : metropolitan = record elif record [ 'division' ] [ 'name' ] == "Atlantic" : atlantic = record elif record [ 'division' ] [ 'name' ] == "Central" : central = record elif record [ 'division' ] [ 'name' ] == "Pacific" : pacific = record division = nhl_api . info . Division ( metropolitan , atlantic , central , pacific ) if conference == 'eastern' and wild_card and division : eastern = nhl_api . info . Wildcard ( wild_card , division ) elif conference == 'western' : western = nhl_api . info . Wildcard ( wild_card , division ) self . by_wildcard = nhl_api . info . Conference ( eastern , western )