From 5c919160e3c6c3476f7ffc760a16c279b93891bd Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Thu, 4 Apr 2024 17:06:26 +0200 Subject: First useful code --- src/match_up/__init__.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/match_up/__init__.py') diff --git a/src/match_up/__init__.py b/src/match_up/__init__.py index 3e74a3d..7b30c1b 100644 --- a/src/match_up/__init__.py +++ b/src/match_up/__init__.py @@ -1,2 +1,19 @@ +from pathlib import PurePath +from time import sleep +from match_up.model import PlayerDatabase +from match_up.tests import generate_test_database, remove_test_database + + +class PlaySession: + def __init__(self, database_location: PurePath): + self.data = PlayerDatabase(database_location) + + def main(): - print("Hello!") + generate_test_database() + s = PlaySession(PurePath("test_storage.json")) + for player in s.data.get_players(): + print(player) + sleep(2) + s.data._database.close() + remove_test_database() -- cgit v1.3.1