Skip to content

finished the sports #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"python.pythonPath": "/bin/python3",
"workbench.colorTheme": "GitHub Dark"
"workbench.colorTheme": "One Dark Pro Darker"
}
6 changes: 3 additions & 3 deletions lib/sports/sportsipy/baseball/baseball.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ async def run(self) -> SportsipyApiResult:
try:
self.logger.info('Running Sportsipy')
sport = {}
team = self.config['sport']['team_id']
team = logo_map[self.config['sport']['team_id']]
self.logger.info("Running Baseball Sportsipy Api")
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
sport['team'] = asyncio.create_task(self.run_team(team.shorthand), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team.shorthand), name="schedule_task")
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
await asyncio.gather(*sport.values())
sport['sport'] = base.SportStructure.Baseball
Expand Down
2 changes: 2 additions & 0 deletions lib/sports/sportsipy/basketball/basketball.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from lib.asynclib import make_async
from datetime import datetime
from lib.run import Runner
from lib.sports.logo import logo_map
import lib.sports.sportbase as base

class BasketballSportsipy(Runner):
Expand Down Expand Up @@ -43,6 +44,7 @@ async def run(self) -> SportsipyApiResult:
sport = {}
team = self.config['sport']['team_id']
self.logger.info("Running Basketball Sportsipy Api")
breakpoint()
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
Expand Down
8 changes: 3 additions & 5 deletions lib/sports/sportsipy/football/football.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ async def run(self) -> SportsipyApiResult:
try:
self.logger.info("Inside of the Football Sportsipy")
sport = {}
team = self.config['sport']['team_id']
team = logo_map[self.config['sport']['team_id']]
self.logger.info("Running Football Sportsipy Api")
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
sport['team'] = asyncio.create_task(self.run_team(team.shorthand), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team.shorthand), name="schedule_task")
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
await asyncio.gather(*sport.values())
sport['sport'] = base.SportStructure.Football
Expand Down Expand Up @@ -86,5 +86,3 @@ async def run(self) -> SportsipyApiResult:
except Exception as error:
self.logger.error(f"Error Occured inside of football module: {error}")
return None


8 changes: 4 additions & 4 deletions lib/sports/sportsipy/hockey/hockey.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ async def run(self) -> SportsipyApiResult:
try:
self.logger.info('Running Sportsipy')
sport = {}
team = self.config['sport']['team_id']
team = logo_map[self.config['sport']['team_id']]
self.logger.info("Running Hockey Sportsipy Api")
sport['team'] = asyncio.create_task(self.run_team(team), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team), name="schedule_task")
sport['team'] = asyncio.create_task(self.run_team(team.shorthand), name="team_task")
sport['schedule'] = asyncio.create_task(self.run_schedule(team.shorthand), name="schedule_task")
sport['standings'] = asyncio.create_task(self.run_standings(), name="standing_task")
await asyncio.gather(*sport.values())
sport['sport'] = base.SportStructure.Hockey
Expand Down Expand Up @@ -86,6 +86,6 @@ async def run(self) -> SportsipyApiResult:
)
return SportsipyApiResult(api_result=hockey_result)
except Exception as error:
self.logger.error(f"An Error Occured in basketball Module: {error}")
self.logger.error(f"An Error Occured in hockey Module: {error}")
return None