Spaces:
Running
Running
Download py/reset.py from eatbackhackathon2026/eatback: direct link, hf CLI and curl.
- Browser
- Download file 916 Bytes
-
https://huggingface.co/spaces/eatbackhackathon2026/eatback/resolve/main/py/reset.py
- Command line
-
hf download hf://spaces/eatbackhackathon2026/eatback/py/reset.py
-
curl -L -o reset.py https://huggingface.co/spaces/eatbackhackathon2026/eatback/resolve/main/py/reset.py
916 Bytes
| """Reset the demo data (stop the server first, or use the reset buttons on the QC page). | |
| python server/reset.py -> ready (today's high-waste menu planned; voice box opens when served) | |
| python server/reset.py full -> full (today's investigation meal served, voted and audited) | |
| python server/reset.py verified -> verified (the whole loop done, trial confirmed twice) | |
| Refused when the database is in real-data mode (see server/data_mode.py). | |
| """ | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parent)) | |
| from db import LOCK # noqa: E402 | |
| from seed import RealDataError, seed # noqa: E402 | |
| preset = sys.argv[1] if len(sys.argv) > 1 and sys.argv[1] in ("ready", "full", "verified") else "ready" | |
| with LOCK: | |
| try: | |
| seed(preset) | |
| except RealDataError as e: | |
| sys.exit(f"Not reset: {e}") | |
| print(f"EatBack demo data reset: {preset}") | |