From 028f6f775d4fe1327975f9688d7433e67f2623e0 Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Fri, 4 Feb 2022 03:16:45 +0000 Subject: [PATCH] get team nums at comp --- src/cli/config.py | 3 ++- src/cli/data.py | 15 ++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/cli/config.py b/src/cli/config.py index 900d151..332607b 100644 --- a/src/cli/config.py +++ b/src/cli/config.py @@ -18,7 +18,8 @@ sample_json = """ "tba":"", "tra":{ "CLIENT_ID":"", - "CLIENT_SECRET":"" + "CLIENT_SECRET":"", + "url": "" } }, "config-preference":"local", diff --git a/src/cli/data.py b/src/cli/data.py index 5df9ac9..9469c21 100644 --- a/src/cli/data.py +++ b/src/cli/data.py @@ -51,17 +51,10 @@ def get_metrics_data_formatted(client, competition): return out def get_pit_data_formatted(client, competition): - db = client.data_scouting - mdata = db.teamlist.competition - x=mdata.find_one({"competition":competition}) # x should be a list of teams given the soecified competition - print(x) - out = {} - for i in x: - try: - out[int(i)] = get_team_pit_data(client, competition, int(i)) - except: - pass - return out + x=requests.get("https://titanscouting.epochml.org/api/fetchAllTeamNicknamesAtCompetition?competition="+competition) + output = x.json() + data = output['data'] + return list(data.keys()) def get_pit_variable_data(client, competition): db = client.data_processing