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)
|
||||
|
||||
args = arg_parser.parse_args()
|
||||
events = init_games()
|
||||
|
||||
if args.team:
|
||||
# find the team
|
||||
print(args.team)
|
||||
found_event= filter(lambda e: e.home_team.abbr.lower() == args.team.lower() or e.away_team.abbr.lower() == args.team.lower(), events)
|
||||
if found_event:
|
||||
event = list(found_event).pop()
|
||||
table = output_game(event)
|
||||
console.print(table)
|
||||
else:
|
||||
print(f"Team not found: {args.team}")
|
||||
else:
|
||||
for event in init_games():
|
||||
for event in events:
|
||||
table = output_game(event)
|
||||
console.print(table)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user