From 499e201179ec699b246f99bc402a7491012a6724 Mon Sep 17 00:00:00 2001 From: GitBluub Date: Wed, 21 Dec 2022 16:02:48 +0900 Subject: [PATCH] read the start message to get song name --- scorometer/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scorometer/main.py b/scorometer/main.py index 4e106ad..811e23d 100644 --- a/scorometer/main.py +++ b/scorometer/main.py @@ -78,7 +78,12 @@ class Scorometer(): self.sendEnd(0, {}) def main(): - sc = Scorometer(sys.argv[1]) + start_message = json.loads(input()) + if start_message["type"] != "start" or "name" not in start_message.keys(): + print(json.dumps({"error": "Error with the start message"})) + exit() + song_name = start_message["name"] + sc = Scorometer(song_name) sc.gameLoop() if __name__ == "__main__":