This code requires Python 3.7 and younger.
Before you start, you may want to setup the virtual environment for Python dependencies.
Setting up Virtual environment:
pip install virtualenv
python -m virtualenv venv
- execute
venv\Scripts\activate.bat
on windows orvenv/Scripts/activate
elsewhere
Install pre-requisites.
pip install -r requirements.txt
python main.py
If using Visual Studio Code, just start the debugger. The launch.json
contains configuration that starts the Python service and then opens the page in Chrome and attaches to the javascript debugger there.
Post this kind of message to http://localhost:5000/update
:
{
"Atomics": {
"water_is_rising": true,
"water_level": 50
}
}
e.g. using Postman.
Page should display input elements according to type (boolean vs numeric).
Post this kind of message to http://localhost:5000/startstop
:
{
"Action": "run_checklist",
"Params": [{ "Name": "Quickly"}],
"IsStopped": false,
}
The template index.html
includes cards for action named run_checklist
and stay_safe
, but if you post any other action name, a dummy card is
created on the fly.
Post "IsStopped": true
to complete the action without waiting for the user.
The page should display cards with buttons to end the process.