diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-02-16 21:03:55 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-02-16 21:03:55 +1300 |
commit | 692556cf20c3feca53b336415cdf8a87a6740651 (patch) | |
tree | 36fc07d4fdb0755b6367f08b4890c2bd04e64592 /libmproxy/console.py | |
parent | 3f0b84bb49a57539e32c5399f42e74d5fe1cd538 (diff) | |
download | mitmproxy-692556cf20c3feca53b336415cdf8a87a6740651.tar.gz mitmproxy-692556cf20c3feca53b336415cdf8a87a6740651.tar.bz2 mitmproxy-692556cf20c3feca53b336415cdf8a87a6740651.zip |
Fix minor display issues in console app.
Diffstat (limited to 'libmproxy/console.py')
-rw-r--r-- | libmproxy/console.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libmproxy/console.py b/libmproxy/console.py index 99bf3a4e..ac1ef16c 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -45,16 +45,16 @@ def format_keyvals(lst, key="key", val="text", space=5, indent=0): return ret -def format_flow(f, focus, extended=False, padding=3): - if not f.request and not f.response: +def format_flow(f, focus, extended=False, padding=2): + if not f.request: txt = [ ("title", " Connection from %s..."%(f.client_conn.address[0])), ] else: if extended: - ts = ("highlight", utils.format_timestamp(f.request.timestamp)) + ts = ("highlight", utils.format_timestamp(f.request.timestamp) + " ") else: - ts = "" + ts = " " txt = [ ts, @@ -67,12 +67,11 @@ def format_flow(f, focus, extended=False, padding=3): ), ] if f.response or f.error or f.is_replay(): - tsr = f.response or f.error if extended and tsr: - ts = ("highlight", utils.format_timestamp(tsr.timestamp)) + ts = ("highlight", utils.format_timestamp(tsr.timestamp) + " ") else: - ts = "" + ts = " " txt.append("\n") txt.append(("text", ts)) @@ -104,6 +103,7 @@ def format_flow(f, focus, extended=False, padding=3): txt.append( ("error", f.error.msg) ) + if focus: txt.insert(0, ("focus", ">>" + " "*(padding-2))) else: @@ -918,6 +918,8 @@ class ConsoleMaster(flow.FlowMaster): self.make_view() def view_connlist(self): + if self.ui.s: + self.ui.clear() if self.currentflow: try: idx = self.state.view.index(self.currentflow) |