Skip to content

Commit

Permalink
Merge pull request #147 from mchac1/players
Browse files Browse the repository at this point in the history
Fixed bug when retrieving players of a team
  • Loading branch information
Saturn authored May 16, 2020
2 parents dd461eb + 0f2243e commit 6b2dec6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions soccer/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ def team_scores(self, team_scores, time, show_datetime, use_12_hour_format):

def team_players(self, team):
"""Prints the team players in a pretty format"""
players = sorted(team, key=lambda d: d['shirtNumber'])
click.secho("%-4s %-25s %-20s %-20s %-15s" %
click.secho("%-6s %-25s %-20s %-20s %-15s" %
("N.", "NAME", "POSITION", "NATIONALITY", "BIRTHDAY"),
bold=True,
fg=self.colors.MISC)
fmt = (u"{shirtNumber:<4} {name:<28} {position:<23} {nationality:<23}"
fmt = (u"{shirtNumber!r:<6} {name:<28} {position:<23} {nationality:<23}"
u" {dateOfBirth:<18}")
for player in players:
click.secho(fmt.format(**player), bold=True)
for player in team:
if player["role"] == "PLAYER":
click.secho(fmt.format(**player), bold=True)

def standings(self, league_table, league):
""" Prints the league standings in a pretty way """
Expand Down

0 comments on commit 6b2dec6

Please sign in to comment.