def find_thesaurus_legues(leagues_found): """ try to match leagues in the DB with those one found on the web page :param leagues_found: :return: """ leagues = League.read_all() for league in leagues: att = True for league_name in league.name.split("|"): if league_name.strip() in leagues_found: att = False if att: print("ATT: league name not found, a thesarus should be there [ " + league_name + " ]")
def find_new_league_to_manage(leagues_found): """ Return leagues that are not managed right now, but they can be :param leagues_found: :return: """ new_league_names = [] leagues = League.read_all() for league_found in leagues_found: new = True for league in leagues: if league_found in league.name: new = False if new: new_league_names.append(league_found) return new_league_names