def view_grideditor(self, ge): signals.push_view_state.send(self, window=window.Window( self, ge, None, statusbar.StatusBar( self, grideditor.base.FOOTER), ge.make_help()))
def test_statusbar(monkeypatch): o = options.Options() m = master.ConsoleMaster(o) m.options.update( setheaders=[":~q:foo:bar"], replacements=[":~q:foo:bar"], ignore_hosts=["example.com", "example.org"], tcp_hosts=["example.tcp"], intercept="~q", view_filter="~dst example.com", stickycookie="~dst example.com", stickyauth="~dst example.com", console_default_contentview="javascript", anticache=True, anticomp=True, showhost=True, server_replay_refresh=False, server_replay_kill_extra=True, upstream_cert=False, stream_large_bodies="3m", mode="transparent", ) m.options.update(view_order='url', console_focus_follow=True) monkeypatch.setattr(m.addons.get("clientplayback"), "count", lambda: 42) monkeypatch.setattr(m.addons.get("serverplayback"), "count", lambda: 42) bar = statusbar.StatusBar(m) # this already causes a redraw assert bar.ib._w
def __init__(self, master): self.statusbar = statusbar.StatusBar(master) super().__init__(None, header=None, footer=urwid.AttrWrap(self.statusbar, "background")) self.master = master self.master.view.sig_view_refresh.connect(self.view_changed) self.master.view.sig_view_add.connect(self.view_changed) self.master.view.sig_view_remove.connect(self.view_changed) self.master.view.sig_view_update.connect(self.view_changed) self.master.view.focus.sig_change.connect(self.view_changed) self.master.view.focus.sig_change.connect(self.focus_changed) signals.focus.connect(self.sig_focus) signals.flow_change.connect(self.flow_changed) signals.pop_view_state.connect(self.pop) signals.push_view_state.connect(self.push) self.master.options.subscribe(self.configure, ["console_layout"]) self.master.options.subscribe(self.configure, ["console_layout_headers"]) self.pane = 0 self.stacks = [ WindowStack(master, "flowlist"), WindowStack(master, "eventlog") ]
def view_help(self): hc = self.view_stack[-1].helpctx signals.push_view_state.send( self, window=window.Window(self, help.HelpView(hc), None, statusbar.StatusBar(self, help.footer), None, "help"))
def view_flow(self, flow, tab_offset=0): self.view.focus.flow = flow signals.push_view_state.send( self, window=window.Window( self, flowview.FlowView(self, self.view, flow, tab_offset), flowview.FlowViewHeader(self, flow), statusbar.StatusBar(self, flowview.footer), flowview.help_context))
def view_commands(self): for i in self.view_stack: if isinstance(i["body"], commands.Commands): return signals.push_view_state.send( self, window=window.Window(self, commands.Commands(self), None, statusbar.StatusBar(self, commands.footer), commands.help_context, "commands"))
def view_options(self): for i in self.view_stack: if isinstance(i["body"], options.Options): return signals.push_view_state.send( self, window=window.Window(self, options.Options(self), None, statusbar.StatusBar(self, options.footer), options.help_context, "options"))
def view_palette_picker(self): signals.push_view_state.send(self, window=window.Window( self, palettepicker.PalettePicker(self), None, statusbar.StatusBar( self, palettepicker.footer), palettepicker.help_context, ))
def view_help(self, helpctx): signals.push_view_state.send( self, window = window.Window( self, help.HelpView(helpctx), None, statusbar.StatusBar(self, help.footer), None ) )
def view_flowlist(self): if self.ui.started: self.ui.clear() if self.options.eventlog: body = flowlist.BodyPile(self) else: body = flowlist.FlowListBox(self) signals.push_view_state.send( self, window=window.Window(self, body, None, statusbar.StatusBar(self, flowlist.footer), flowlist.help_context))