diff --git a/.gitignore b/.gitignore index 5a9ad5a..e0313ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ /nhle_standings_response.txt /app/data/nhl_standings.db /app/data/scoreboard_data.json -/__pycache__ -/app/__pycache__ -/app/scoreboard/__pycache__ nhl_standings.db +**/__pycache__ +.venv/ diff --git a/app/scoreboard/get_data.py b/app/api.py similarity index 100% rename from app/scoreboard/get_data.py rename to app/api.py diff --git a/app/scoreboard/process_data.py b/app/games.py similarity index 100% rename from app/scoreboard/process_data.py rename to app/games.py diff --git a/app/routes.py b/app/routes.py index da876be..f76530b 100644 --- a/app/routes.py +++ b/app/routes.py @@ -4,7 +4,7 @@ from flask import render_template, jsonify from app import app 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("/") diff --git a/app/scoreboard/tasks.py b/app/scheduler.py similarity index 72% rename from app/scoreboard/tasks.py rename to app/scheduler.py index 566c947..7276f93 100644 --- a/app/scoreboard/tasks.py +++ b/app/scheduler.py @@ -3,8 +3,8 @@ import time import schedule -from app.scoreboard.get_data import store_scoreboard_data -from app.scoreboard.update_nhl_standings_db import update_nhl_standings +from app.api import store_scoreboard_data +from app.standings import update_nhl_standings logger = logging.getLogger(__name__) diff --git a/app/scoreboard/__init__.py b/app/scoreboard/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/scoreboard/update_nhl_standings_db.py b/app/standings.py similarity index 100% rename from app/scoreboard/update_nhl_standings_db.py rename to app/standings.py diff --git a/run.py b/run.py index 9c8e54e..7ce91c7 100644 --- a/run.py +++ b/run.py @@ -1,9 +1,9 @@ import threading from app import app from app.config import PORT -from app.scoreboard.tasks import schedule_tasks -from app.scoreboard.get_data import store_scoreboard_data -from app.scoreboard.update_nhl_standings_db import update_nhl_standings +from app.scheduler import schedule_tasks +from app.api import store_scoreboard_data +from app.standings import update_nhl_standings from waitress import serve if __name__ == "__main__": diff --git a/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc b/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc index a1aeb51..6eb554d 100644 Binary files a/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc and b/tests/__pycache__/conftest.cpython-313-pytest-8.3.4.pyc differ diff --git a/tests/conftest.py b/tests/conftest.py index 12c0950..34f6ccf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -81,10 +81,10 @@ def flask_client(tmp_path, monkeypatch): # Patch module-level path constants so no reloads are needed 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(process_data, "DB_PATH", str(db_path)) + monkeypatch.setattr(games, "DB_PATH", str(db_path)) from app import app as flask_app diff --git a/tests/test_process_data.py b/tests/test_games.py similarity index 98% rename from tests/test_process_data.py rename to tests/test_games.py index f9df1af..f791545 100644 --- a/tests/test_process_data.py +++ b/tests/test_games.py @@ -1,5 +1,5 @@ from tests.conftest import make_game -from app.scoreboard.process_data import ( +from app.games import ( convert_game_state, get_game_outcome, process_period,