MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / Tab

Class Tab

mitmproxy/tools/console/tabs.py:4–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3
4class Tab(urwid.WidgetWrap):
5 def __init__(self, offset, content, attr, onclick):
6 """
7 onclick is called on click with the tab offset as argument
8 """
9 p = urwid.Text(content, align="center")
10 p = urwid.Padding(p, align="center", width=("relative", 100))
11 p = urwid.AttrMap(p, attr)
12 urwid.WidgetWrap.__init__(self, p)
13 self.offset = offset
14 self.onclick = onclick
15
16 def mouse_event(self, size, event, button, col, row, focus):
17 if event == "mouse press" and button == 1:
18 self.onclick(self.offset)
19 return True
20
21
22class Tabs(urwid.WidgetWrap):

Callers 1

showMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected