From: Christian Heller Date: Sat, 7 Nov 2015 20:47:22 +0000 (+0100) Subject: New client: Reorganize code. X-Git-Tag: tce~256 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/todo?a=commitdiff_plain;h=56eea48c45b4702bc32a6615b676f7e8966089f4;p=plomrogue New client: Reorganize code. --- 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)