architv / soccer-cli

:soccer: Football scores for hackers. :computer: A command line interface for all the football scores.
MIT License
1.09k stars 222 forks source link

Add league header when printing live scores. #35

Closed carlosvargas closed 8 years ago

carlosvargas commented 8 years ago

In #30 I added some code to print the league name in a pretty manner. When printing the live scores, the scores are already sorted by league, but it prepends the name of the league before each score:

 Premier League  Everton              3    vs    1 Chelsea       FT
 Premier League  Arsenal              2    vs    0 Stoke City    FT
 Premier League  Crystal Palace       0    vs    1 Manchester City       FT
 Premier League  Norwich City         3    vs    1 AFC Bournemouth       FT
 Premier League  Watford              1    vs    0 Swansea City  FT
 Premier League  West Bromwich Albion 0    vs    0 Southampton   FT
 Premier League  Manchester United    0    vs    0 Liverpool     32'

making the results somewhat dense.

This PR changes it to print out the league name the same way as #30

==================== Premier League ====================

Everton              3    vs    1 Chelsea       FT
Arsenal              2    vs    0 Stoke City    FT
Crystal Palace       0    vs    1 Manchester City       FT
Norwich City         3    vs    1 AFC Bournemouth       FT
Watford              1    vs    0 Swansea City  FT
West Bromwich Albion 0    vs    0 Southampton   FT
Manchester United    0    vs    0 Liverpool     34'
ueg1990 commented 8 years ago

Hey, can we keep this on hold for a bit. I am currently writing some logic to be able to output result to a CSV and JSON file Issue 25

Though it may take a while, it can be useful functionality. Is that ok with you and @architv and @Saturn

Saturn commented 8 years ago

@ueg1990 Will this PR affect that a lot?

@carlosvargas So the data from the live scores contains the full league names? Interesting.

This makes the live output look nice :+1:

ueg1990 commented 8 years ago

I have already made a pull request. the one thing that @carlosvargas may need to do is make the call print_league_header(league) inside print_live_scores(games)

architv commented 8 years ago

@carlosvargas Sorry, I messed up the merge. #36 was creating conflicts with your PR. Could you please check it and open another PR.

carlosvargas commented 8 years ago

@architv not a problem. I'll look into it.