Fix minor display issues in console app.

This commit is contained in:
Aldo Cortesi 2011-02-16 21:03:55 +13:00
parent 3f0b84bb49
commit 692556cf20

View File

@ -45,14 +45,14 @@ def format_keyvals(lst, key="key", val="text", space=5, indent=0):
return ret return ret
def format_flow(f, focus, extended=False, padding=3): def format_flow(f, focus, extended=False, padding=2):
if not f.request and not f.response: if not f.request:
txt = [ txt = [
("title", " Connection from %s..."%(f.client_conn.address[0])), ("title", " Connection from %s..."%(f.client_conn.address[0])),
] ]
else: else:
if extended: if extended:
ts = ("highlight", utils.format_timestamp(f.request.timestamp)) ts = ("highlight", utils.format_timestamp(f.request.timestamp) + " ")
else: else:
ts = " " ts = " "
@ -67,10 +67,9 @@ def format_flow(f, focus, extended=False, padding=3):
), ),
] ]
if f.response or f.error or f.is_replay(): if f.response or f.error or f.is_replay():
tsr = f.response or f.error tsr = f.response or f.error
if extended and tsr: if extended and tsr:
ts = ("highlight", utils.format_timestamp(tsr.timestamp)) ts = ("highlight", utils.format_timestamp(tsr.timestamp) + " ")
else: else:
ts = " " ts = " "
@ -104,6 +103,7 @@ def format_flow(f, focus, extended=False, padding=3):
txt.append( txt.append(
("error", f.error.msg) ("error", f.error.msg)
) )
if focus: if focus:
txt.insert(0, ("focus", ">>" + " "*(padding-2))) txt.insert(0, ("focus", ">>" + " "*(padding-2)))
else: else:
@ -918,6 +918,8 @@ class ConsoleMaster(flow.FlowMaster):
self.make_view() self.make_view()
def view_connlist(self): def view_connlist(self):
if self.ui.s:
self.ui.clear()
if self.currentflow: if self.currentflow:
try: try:
idx = self.state.view.index(self.currentflow) idx = self.state.view.index(self.currentflow)