def test_format_flow(): flows = [ tflow.tflow(resp=True), tflow.tflow(err=True), tflow.ttcpflow(), tflow.ttcpflow(err=True), ] for f in flows: for render_mode in common.RenderMode: assert common.format_flow(f, render_mode=render_mode) assert common.format_flow(f, render_mode=render_mode, hostheader=True, focused=False)
def sig_flow_change(self, sender, flow): if flow == self.flow: self._w = common.format_flow( flow, False, extended=True, hostheader=self.master.options.showhost)
def sig_flow_change(self, sender, flow): if flow == self.flow: self._w = common.format_flow( flow, False, extended=True, hostheader=self.master.options.showhost )
def get_text(self): cols, _ = self.master.ui.get_cols_rows() return common.format_flow( self.flow, self.flow is self.master.view.focus.flow, hostheader=self.master.options.showhost, max_url_len=cols, )
def get_text(self): cols, _ = self.master.ui.get_cols_rows() return common.format_flow( self.flow, self.flow is self.master.view.focus.flow, hostheader=self.master.options.showhost, cols=cols, layout=self.master.options.console_flowlist_layout )
def __init__(self, master: "mitmproxy.console.master.ConsoleMaster", f: http.HTTPFlow): self.master = master self.flow = f self._w = common.format_flow(f, False, extended=True, hostheader=self.master.options.showhost) signals.flow_change.connect(self.sig_flow_change)
def focus_changed(self): if self.master.view.focus.flow: self._w = common.format_flow( self.master.view.focus.flow, False, extended=True, hostheader=self.master.options.showhost) else: self._w = urwid.Pile([])
def focus_changed(self): cols, _ = self.master.ui.get_cols_rows() if self.master.view.focus.flow: self._w = common.format_flow( self.master.view.focus.flow, render_mode=common.RenderMode.DETAILVIEW, hostheader=self.master.options.showhost, ) else: self._w = urwid.Pile([])
def __init__(self, master: "mitmproxy.console.master.ConsoleMaster", f: http.HTTPFlow): self.master = master self.flow = f self._w = common.format_flow( f, False, extended=True, hostheader=self.master.options.showhost ) signals.flow_change.connect(self.sig_flow_change)
def focus_changed(self): if self.master.view.focus.flow: self._w = common.format_flow( self.master.view.focus.flow, False, extended=True, hostheader=self.master.options.showhost ) else: self._w = urwid.Pile([])
def focus_changed(self): cols, _ = self.master.ui.get_cols_rows() if self.master.view.focus.flow: self._w = common.format_flow( self.master.view.focus.flow, False, extended=True, hostheader=self.master.options.showhost, max_url_len=cols, ) else: self._w = urwid.Pile([])
def focus_changed(self): cols, _ = self.master.ui.get_cols_rows() if self.master.view.focus.flow: self._w = common.format_flow( self.master.view.focus.flow, False, extended=True, hostheader=self.master.options.showhost, cols=cols, layout=self.master.options.console_flowlist_layout) else: self._w = urwid.Pile([])
def get_text(self): cols, _ = self.master.ui.get_cols_rows() layout = self.master.options.console_flowlist_layout if layout == "list" or (layout == 'default' and cols < 100): render_mode = common.RenderMode.LIST else: render_mode = common.RenderMode.TABLE return common.format_flow( self.flow, render_mode=render_mode, focused=self.flow is self.master.view.focus.flow, hostheader=self.master.options.showhost, )
def test_format_flow(): f = tflow.tflow(resp=True) assert common.format_flow(f, True) assert common.format_flow(f, True, hostheader=True) assert common.format_flow(f, True, extended=True)