refactor: flatten app/scoreboard/ subpackage and rename files for clarity
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -2,7 +2,6 @@
|
|||||||
/nhle_standings_response.txt
|
/nhle_standings_response.txt
|
||||||
/app/data/nhl_standings.db
|
/app/data/nhl_standings.db
|
||||||
/app/data/scoreboard_data.json
|
/app/data/scoreboard_data.json
|
||||||
/__pycache__
|
|
||||||
/app/__pycache__
|
|
||||||
/app/scoreboard/__pycache__
|
|
||||||
nhl_standings.db
|
nhl_standings.db
|
||||||
|
**/__pycache__
|
||||||
|
.venv/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from flask import render_template, jsonify
|
|||||||
|
|
||||||
from app import app
|
from app import app
|
||||||
from app.config import SCOREBOARD_DATA_FILE
|
from app.config import SCOREBOARD_DATA_FILE
|
||||||
from app.scoreboard.process_data import extract_game_info
|
from app.games import extract_game_info
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import time
|
|||||||
|
|
||||||
import schedule
|
import schedule
|
||||||
|
|
||||||
from app.scoreboard.get_data import store_scoreboard_data
|
from app.api import store_scoreboard_data
|
||||||
from app.scoreboard.update_nhl_standings_db import update_nhl_standings
|
from app.standings import update_nhl_standings
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
6
run.py
6
run.py
@@ -1,9 +1,9 @@
|
|||||||
import threading
|
import threading
|
||||||
from app import app
|
from app import app
|
||||||
from app.config import PORT
|
from app.config import PORT
|
||||||
from app.scoreboard.tasks import schedule_tasks
|
from app.scheduler import schedule_tasks
|
||||||
from app.scoreboard.get_data import store_scoreboard_data
|
from app.api import store_scoreboard_data
|
||||||
from app.scoreboard.update_nhl_standings_db import update_nhl_standings
|
from app.standings import update_nhl_standings
|
||||||
from waitress import serve
|
from waitress import serve
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Binary file not shown.
@@ -81,10 +81,10 @@ def flask_client(tmp_path, monkeypatch):
|
|||||||
|
|
||||||
# Patch module-level path constants so no reloads are needed
|
# Patch module-level path constants so no reloads are needed
|
||||||
import app.routes as routes
|
import app.routes as routes
|
||||||
import app.scoreboard.process_data as process_data
|
import app.games as games
|
||||||
|
|
||||||
monkeypatch.setattr(routes, "SCOREBOARD_DATA_FILE", str(scoreboard_file))
|
monkeypatch.setattr(routes, "SCOREBOARD_DATA_FILE", str(scoreboard_file))
|
||||||
monkeypatch.setattr(process_data, "DB_PATH", str(db_path))
|
monkeypatch.setattr(games, "DB_PATH", str(db_path))
|
||||||
|
|
||||||
from app import app as flask_app
|
from app import app as flask_app
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from tests.conftest import make_game
|
from tests.conftest import make_game
|
||||||
from app.scoreboard.process_data import (
|
from app.games import (
|
||||||
convert_game_state,
|
convert_game_state,
|
||||||
get_game_outcome,
|
get_game_outcome,
|
||||||
process_period,
|
process_period,
|
||||||
Reference in New Issue
Block a user