Get only the score for a specific team
This commit is contained in:
parent
6406947dcd
commit
04553a4884
12
main.py
12
main.py
@ -26,12 +26,18 @@ def main():
|
|||||||
required=False)
|
required=False)
|
||||||
|
|
||||||
args = arg_parser.parse_args()
|
args = arg_parser.parse_args()
|
||||||
|
events = init_games()
|
||||||
|
|
||||||
if args.team:
|
if args.team:
|
||||||
# find the team
|
found_event= filter(lambda e: e.home_team.abbr.lower() == args.team.lower() or e.away_team.abbr.lower() == args.team.lower(), events)
|
||||||
print(args.team)
|
if found_event:
|
||||||
|
event = list(found_event).pop()
|
||||||
|
table = output_game(event)
|
||||||
|
console.print(table)
|
||||||
|
else:
|
||||||
|
print(f"Team not found: {args.team}")
|
||||||
else:
|
else:
|
||||||
for event in init_games():
|
for event in events:
|
||||||
table = output_game(event)
|
table = output_game(event)
|
||||||
console.print(table)
|
console.print(table)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user