diff options
| author | Aldo Cortesi <aldo@corte.si> | 2018-05-12 11:05:01 +1200 |
|---|---|---|
| committer | Aldo Cortesi <aldo@corte.si> | 2018-05-12 11:10:33 +1200 |
| commit | a70b50fe3a3065345cf26112a2148c648695b9d9 (patch) | |
| tree | 41ad827277f1fdfe60edb45605cd821cc41be944 | |
| parent | 482043cdcfbcf48ecd7a0185a20c8678ce7deb0d (diff) | |
| download | mitmproxy-a70b50fe3a3065345cf26112a2148c648695b9d9.tar.gz mitmproxy-a70b50fe3a3065345cf26112a2148c648695b9d9.tar.bz2 mitmproxy-a70b50fe3a3065345cf26112a2148c648695b9d9.zip | |
console: implement positions for flow list walker
This papers over an urwid bug until they fix it.
fixes #2973
| -rw-r--r-- | mitmproxy/tools/console/flowlist.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py index e6bd1693..a9e48af4 100644 --- a/mitmproxy/tools/console/flowlist.py +++ b/mitmproxy/tools/console/flowlist.py @@ -39,6 +39,14 @@ class FlowListWalker(urwid.ListWalker): def __init__(self, master): self.master = master + def positions(self, reverse=False): + # The stub implementation of positions can go once this issue is resolved: + # https://github.com/urwid/urwid/issues/294 + ret = range(len(self.master.view)) + if reverse: + return reversed(ret) + return ret + def view_changed(self): self._modified() |
