From d6168cfed15b3a34464ebe2248aa80075e64b184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=B3=20Albert=20i=20Beltran?= Date: Thu, 14 May 2015 17:18:43 +0200 Subject: [PATCH] console decoration of wsdump.py inside InteractiveConsole --- bin/wsdump.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/wsdump.py b/bin/wsdump.py index 993bad0..875e10b 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -59,7 +59,7 @@ class InteractiveConsole(code.InteractiveConsole): def write(self, data): sys.stdout.write("\033[2K\033[E") # sys.stdout.write("\n") - sys.stdout.write("\033[34m" + data + "\033[39m") + sys.stdout.write("\033[34m< " + data + "\033[39m") sys.stdout.write("\n> ") sys.stdout.flush() @@ -117,9 +117,9 @@ def main(): opcode, data = recv() msg = None if not args.verbose and opcode in OPCODE_DATA: - msg = "< %s" % data + msg = data elif args.verbose: - msg = "< %s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data) + msg = "%s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data) if msg is not None: console.write(msg)