summaryrefslogtreecommitdiff
path: root/src/match_up/__init__.py
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2024-11-09 19:11:26 +0100
committerKaran Jayachandra <mail@karanjayachandra.com>2024-11-09 19:11:26 +0100
commit75a3ef7d14fcaedab29da46ba3dc5cf9c1bab699 (patch)
tree5b771e755f3a55c6794c649431de35798242a2e0 /src/match_up/__init__.py
parentaa73a7618075b54940d32b7b1e0e751b301bee4d (diff)
Added the functionality to automatically generate names or use a local database
Diffstat (limited to 'src/match_up/__init__.py')
-rw-r--r--src/match_up/__init__.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/match_up/__init__.py b/src/match_up/__init__.py
index 996bf9a..3aa3b98 100644
--- a/src/match_up/__init__.py
+++ b/src/match_up/__init__.py
@@ -1,12 +1,10 @@
from flask import Flask
-from dotenv import load_dotenv
from argparse import ArgumentParser
from importlib.resources import path
from match_up.utilities import Timer
from match_up.controller import RoundGenerator
from match_up.model import CourtList, PlayerList
-load_dotenv()
with path("match_up", "static") as p:
static_folder = p
with path("match_up", "templates") as p:
@@ -22,14 +20,12 @@ from match_up import routes
def main():
parser = ArgumentParser()
- parser.add_argument(
- "-t", "--timer", help="Total mins per round", type=float, default=12
- )
- parser.add_argument(
- "-c", "--courts", help="Total number of courts", type=int, default=12
- )
+ parser.add_argument("-t", "--timer", help="Min per round", type=float, default=12)
+ parser.add_argument("-c", "--courts", help="Total courts", type=int, default=12)
+ parser.add_argument("-d", "--database", help="CSV database", default=None)
args = parser.parse_args()
global rg
rg.courts = CourtList(total=args.courts)
rg.timer = Timer(max_mins=args.timer)
+ rg.players = PlayerList(location=args.database)
app.run()