diff options
| author | Karan Jayachandra <mail@karanjayachandra.com> | 2024-10-14 08:51:59 +0000 |
|---|---|---|
| committer | Karan Jayachandra <mail@karanjayachandra.com> | 2024-10-14 08:51:59 +0000 |
| commit | eac95cc2e259badf3a8c3309e6e7be97d5cbd868 (patch) | |
| tree | 492b1497cf648e08e84a35dea2d217a57643dab0 /src/match_up/__init__.py | |
| parent | 2b264abdf62822936e3510b0f9690ba1e359a9b8 (diff) | |
| parent | f80463a6437533deef1d85ffa31cf0cc5ed8e454 (diff) | |
Merge branch 'pure' into 'develop'
Dash to Flask HTML Conversion
See merge request KaranJayachandra/match_up!1
Diffstat (limited to 'src/match_up/__init__.py')
| -rw-r--r-- | src/match_up/__init__.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/match_up/__init__.py b/src/match_up/__init__.py deleted file mode 100644 index 95f767e..0000000 --- a/src/match_up/__init__.py +++ /dev/null @@ -1,60 +0,0 @@ -from dash import Dash -from pathlib import PurePath -from importlib.resources import files -from match_up.model import PlaySession -from match_up.view import MainLayout -from match_up.tests import ( - TEST_DATABASE_LOCATION, -) -from dash_bootstrap_components.themes import ZEPHYR -from flask import Flask, render_template - -DATABASE_LOCATION = "storage.json" - - -# class Application: -# def __init__(self, debug=False): -# self._debug = debug -# if debug: -# database_location = TEST_DATABASE_LOCATION -# else: -# database_location = DATABASE_LOCATION -# self._session = PlaySession(PurePath(database_location)) -# self._dashboard = Dash("Match Up!", external_stylesheets=[ZEPHYR]) -# self._layout = MainLayout( -# self._session.data.get_players(), self._session.get_matches() -# ) -# self._dashboard.layout = self._layout.get() - -# def run(self): -# self._dashboard.run(debug=self._debug) - - -# def main(): -# a = Application(debug=True) -# a.run() - - -app = Flask("Match Up", template_folder="templates") -session = PlaySession(PurePath("test_storage.json")) -base_template_path = "match_up.templates" - - -@app.route("/") -def home(): - print(files(base_template_path).joinpath("index.html").name) - # return render_template( - # files(base_template_path).joinpath("index.html").name, - # title="My Generated Page", - # people=session.data.get_players(), - # ) - return render_template( - "index.html", - title="My Generated Page", - people=session.data.get_players(), - ) - - -if __name__ == "__main__": - print("Starting app") - app.run(host="localhost", debug=True, port=80) |
