From f48223b3d93e54cb9ed3f2174e9b6075719128bf Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Fri, 5 Apr 2024 14:08:01 +0200 Subject: Some progress on the dash application --- src/match_up/__init__.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/match_up/__init__.py') diff --git a/src/match_up/__init__.py b/src/match_up/__init__.py index 2b1e42b..c41394a 100644 --- a/src/match_up/__init__.py +++ b/src/match_up/__init__.py @@ -1,25 +1,31 @@ +from dash import Dash from pathlib import PurePath from match_up.model import PlaySession +from match_up.view import MainLayout from match_up.tests import ( TEST_DATABASE_LOCATION, - generate_test_database, - activate_random_players, ) +from dash_bootstrap_components.themes import ZEPHYR 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._session = PlaySession(PurePath(database_location)) + self._dashboard = Dash("Match Up!", external_stylesheets=[ZEPHYR]) + self._layout = MainLayout(self._session.data.get_players()) + self._dashboard.layout = self._layout.get() + + def run(self): + self._dashboard.run(debug=self._debug) def main(): - generate_test_database() - activate_random_players() a = Application(debug=True) - print(a.session) + a.run() -- cgit v1.3.1