From b736c7956812f6aadb1fa36a541dc7ff12576133 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 11 Oct 2018 00:03:52 +0000 Subject: [PATCH] Complain when there are no puzzle directories --- devel/devel-server.py | 2 ++ docs/devel-server.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/devel/devel-server.py b/devel/devel-server.py index 5762efc..e05bc94 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -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), diff --git a/docs/devel-server.md b/docs/devel-server.md index 7058596..bc05d3a 100644 --- a/docs/devel-server.md +++ b/docs/devel-server.md @@ -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