Skip to content

Commit fd49107

Browse files
authored
Merge pull request #92 from TheFinalJoke/sportsipy_hockey
finished the sports
2 parents e8fcc49 + 854e3fc commit fd49107

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"python.pythonPath": "/bin/python3",
3-
"workbench.colorTheme": "GitHub Dark"
3+
"workbench.colorTheme": "One Dark Pro Darker"
44
}

lib/sports/sportsipy/baseball/baseball.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ async def run(self) -> SportsipyApiResult:
3838
try:
3939
self.logger.info('Running Sportsipy')
4040
sport = {}
41-
team = self.config['sport']['team_id']
41+
team = logo_map[self.config['sport']['team_id']]
4242
self.logger.info("Running Baseball Sportsipy Api")
43-
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
44-
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
43+
sport['team'] = asyncio.create_task(self.run_team(team.shorthand), name="team_task")
44+
sport['schedule'] = asyncio.create_task(self.run_schedule(team.shorthand), name="schedule_task")
4545
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
4646
await asyncio.gather(*sport.values())
4747
sport['sport'] = base.SportStructure.Baseball

lib/sports/sportsipy/basketball/basketball.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from lib.asynclib import make_async
1111
from datetime import datetime
1212
from lib.run import Runner
13+
from lib.sports.logo import logo_map
1314
import lib.sports.sportbase as base
1415

1516
class BasketballSportsipy(Runner):
@@ -43,6 +44,7 @@ async def run(self) -> SportsipyApiResult:
4344
sport = {}
4445
team = self.config['sport']['team_id']
4546
self.logger.info("Running Basketball Sportsipy Api")
47+
breakpoint()
4648
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
4749
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
4850
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")

lib/sports/sportsipy/football/football.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ async def run(self) -> SportsipyApiResult:
3535
try:
3636
self.logger.info("Inside of the Football Sportsipy")
3737
sport = {}
38-
team = self.config['sport']['team_id']
38+
team = logo_map[self.config['sport']['team_id']]
3939
self.logger.info("Running Football Sportsipy Api")
40-
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
41-
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
40+
sport['team'] = asyncio.create_task(self.run_team(team.shorthand), name="team_task")
41+
sport['schedule'] = asyncio.create_task(self.run_schedule(team.shorthand), name="schedule_task")
4242
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
4343
await asyncio.gather(*sport.values())
4444
sport['sport'] = base.SportStructure.Football
@@ -86,5 +86,3 @@ async def run(self) -> SportsipyApiResult:
8686
except Exception as error:
8787
self.logger.error(f"Error Occured inside of football module: {error}")
8888
return None
89-
90-

lib/sports/sportsipy/hockey/hockey.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ async def run(self) -> SportsipyApiResult:
3737
try:
3838
self.logger.info('Running Sportsipy')
3939
sport = {}
40-
team = self.config['sport']['team_id']
40+
team = logo_map[self.config['sport']['team_id']]
4141
self.logger.info("Running Hockey Sportsipy Api")
42-
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
43-
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
42+
sport['team'] = asyncio.create_task(self.run_team(team.shorthand), name="team_task")
43+
sport['schedule'] = asyncio.create_task(self.run_schedule(team.shorthand), name="schedule_task")
4444
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
4545
await asyncio.gather(*sport.values())
4646
sport['sport'] = base.SportStructure.Hockey
@@ -86,6 +86,6 @@ async def run(self) -> SportsipyApiResult:
8686
)
8787
return SportsipyApiResult(api_result=hockey_result)
8888
except Exception as error:
89-
self.logger.error(f"An Error Occured in basketball Module: {error}")
89+
self.logger.error(f"An Error Occured in hockey Module: {error}")
9090
return None
9191

0 commit comments

Comments
 (0)