diff --git a/API/main.py b/API/main.py index 66a2078..70ab195 100644 --- a/API/main.py +++ b/API/main.py @@ -21,7 +21,8 @@ def display_text(): y_coord = data.get('y') matrix.text(x_coord, y_coord, text) - except: + except Exception as e: + print(e) response['success'] = False return jsonify(response) @@ -33,7 +34,8 @@ def update_matrix(): try: global matrix matrix.update() - except: + except Exception as e: + print(e) response['success'] = False return jsonify(response) @@ -54,9 +56,12 @@ class Matrix(SampleBase): while True: time.sleep(.05) + def clear(self): + self.canvas.Clear() + def update(self): self.canvas = self.matrix.SwapOnVSync(self.canvas) - self.canvas.Clear() + self.clear() def text(self, x, y, t): graphics.DrawText(self.canvas, self.font, x*9, (y+1)*18, self.color, t)