Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Add quicker engine status check
Browse files Browse the repository at this point in the history
  • Loading branch information
sourque committed May 18, 2020
1 parent f7ad613 commit 663ab03
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions engine/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ def service():
return render_template("scores_service.html", teams = em.teams, scores = scores, \
rg = red_or_green)

@app.route('/scores/css', methods=['GET', 'POST'])


@app.route('/scores/css')
# @admin_required # Uncomment this line if you want to prevent people from seeing the scoreboard without being admin
def css():
print("1")
em.load()
if "css_mode" in em.settings:
css_mode = em.settings["css_mode"]
Expand All @@ -172,18 +174,14 @@ def css():
else:
event = None
if "team" in request.args:
print("2")
teams = db.get_css_teams(em.remote)
team = request.args["team"]
team_name = team
print("3")
if not team in teams:
team = db.remove_alias(request.args["team"], em.remote)
print("4")
if team in teams:
labels, image_data, scores = db.get_css_score(team, em.remote)
total_score = 0
print("5")
for image in image_data.values():
total_score += image[3]

Expand Down Expand Up @@ -258,9 +256,7 @@ def css_update():

@app.route('/scores/css/status')
def css_status():
em.load()
# time elapsed
return("pong + inject commands")
return("OK")

@app.route('/scores/css/export')
def css_csv():
Expand Down

0 comments on commit 663ab03

Please sign in to comment.