From 56eea48c45b4702bc32a6615b676f7e8966089f4 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 7 Nov 2015 21:47:22 +0100 Subject: [PATCH] New client: Reorganize code. --- client_prototype.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client_prototype.py b/client_prototype.py index 815ae7e..c828f7d 100644 --- a/client_prototype.py +++ b/client_prototype.py @@ -214,10 +214,9 @@ def cursed_main(stdscr): draw_screen() cursed_main.redraw = False char = stdscr.getch() - if (char >= 0): - if chr(char) in commands: - commands[chr(char)]() - cursed_main.redraw = True + if char >= 0 and chr(char) in commands: + commands[chr(char)]() + cursed_main.redraw = True new_data_from_server = io["file_in"].read() ping_test(len(new_data_from_server) > 0) read_into_message_queue(new_data_from_server) -- 2.30.2