From 7272edb7d51b6659a901520316680ade23dc9268 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 26 May 2019 22:37:58 +0200 Subject: [PATCH] ++ make points a bit nicer --- server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 23dac6c..b63382b 100644 --- a/server.py +++ b/server.py @@ -189,6 +189,9 @@ class Game(object): point_path = "{}/points".format(user.key) points = self.read_etcd(point_path, recursive=True) + if not points: + continue + for challenge in points.children: user_points[username] += int(challenge.value) @@ -217,7 +220,11 @@ https://code.ungleich.ch/nico/ungleich-game for k, v in point_list.items(): res.append("{} has {} points".format(k, v)) - return "\n".join(res) + return """ +Point list (aka high score) +--------------------------- +{} +""".format("\n".join(res)) def register(self): args = require_args("user")