A HTTP interface around SRComp, the fifth round of Student Robotics competition software.
This repository provides a JSON API to accessing information about the state of the competition. It is a lightweight Flask application wrapping the SRComp python APIs to the competition state.
Install:
pip install sr.comp.http
Configuration
In deployment you should configure the app by setting the COMPSTATE
key of
the app's config to the absolute path of the compstate which the server intends
to serve.
from sr.comp.http import app
app.config['COMPSTATE'] = '/path/to/compstate'
Clone:
For tests to work, you will need to clone the tests/dummy submodule too:
git submodule update --init
Install:
pip install -e .
Run:
./run $COMPSTATE
.
Test:
./run-tests
Developers may wish to use the SRComp Dev repo to setup a dev instance.
Since loading a given state repo takes a non-trivial amount of time,
this is cached within the Flask application. Updates to the state repo
are not tracked directly, and must be signalled by running the
./update
script provided.