Complain when there are no puzzle directories

This commit is contained in:
Neale Pickett 2018-10-11 00:03:52 +00:00
parent aa23e248b4
commit b736c79568
2 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,8 @@ async def handle_puzzlelist(request):
cat = moth.Category(p, seed)
puzzles[catName] = [[i, str(i)] for i in cat.pointvals()]
puzzles[catName].append([0, ""])
if len(puzzles) <= 1:
logging.warning("No directories found matching {}/*".format(request.app["puzzles_dir"]))
return web.Response(
content_type="application/json",
body=json.dumps(puzzles),

View File

@ -30,7 +30,7 @@ try this:
apt install python3
git clone https://github.com/dirtbags/moth/
cd moth
./devel-server.py --puzzles example-puzzles
python3 devel/devel-server.py --puzzles example-puzzles
Installing New Puzzles