def add_player_to_team(): if len(free_players) < 1 or len(teams) < 1: Console.print("Not enough players or teams generated") else: show_free_players() player = Utils.choose_one_from_list(free_players) show_teams() team = Utils.choose_one_from_list(teams) team.add_player(player) free_players.remove(player)
def show_teams(): if len(teams) > 0: print("Team List:") for i, team in enumerate(teams): print("{}. {} ({})".format(i + 1, team.name, team.nationality)) team = Utils.choose_one_from_list(teams) print(team) print("Players:") for player in team.players: print("{}".format(player)) else: Console.print("No teams available", "r")
def parse(output, file_path=None): output_file_name = '{}.{}'.format(config['output_file_name'], output) Console.print('converting csv data in {}'.format(output), 'g') if file_path is None: file_path = config['default_file'] if os.path.isfile(file_path): if len(pycsverter.result_list) == 0: parsed = import_from_csv(file_path) validate_dict(parsed) Console.print_yellow('Printing output ({}), on file {}'.format(output, output_file_name)) OutputDumper.dump(pycsverter.result_list, output, output_file_name) Console.print_green('Done!') else: Console.print_red( 'File not found in path {}, please specify a valid filePath'.format(file_path))
def default(self, line): Console.print('Invalid command, type "help" for a list of commands')
def show_free_players(): if len(free_players) > 0: for i, player in enumerate(free_players): print("{} . {}".format(i + 1, player)) else: Console.print("No free players available", "r")