diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-12-11 14:50:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-11 14:50:20 +0100 |
commit | b62b92eabe9d6ab1c3ecea87a18740eef730f157 (patch) | |
tree | b245f5fba6faffdfc3341a516d649d43e3312553 | |
parent | 610433f204d6a8774ec0b16c5b08c40c33aeccfe (diff) | |
parent | bdba8859229db9349aa656ec2b9b9299e2e7dca2 (diff) | |
download | mitmproxy-b62b92eabe9d6ab1c3ecea87a18740eef730f157.tar.gz mitmproxy-b62b92eabe9d6ab1c3ecea87a18740eef730f157.tar.bz2 mitmproxy-b62b92eabe9d6ab1c3ecea87a18740eef730f157.zip |
Merge pull request #1840 from mhils/1829
fix #1829
-rw-r--r-- | mitmproxy/tools/console/flowview.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/mitmproxy/tools/console/flowview.py b/mitmproxy/tools/console/flowview.py index ecb070d8..efeab647 100644 --- a/mitmproxy/tools/console/flowview.py +++ b/mitmproxy/tools/console/flowview.py @@ -1,23 +1,23 @@ import math import os import sys +from functools import lru_cache +from typing import Optional, Union # noqa import urwid -from mitmproxy import exceptions -from typing import Optional, Union # noqa from mitmproxy import contentviews +from mitmproxy import exceptions +from mitmproxy import export from mitmproxy import http +from mitmproxy.net.http import Headers +from mitmproxy.net.http import status_codes from mitmproxy.tools.console import common from mitmproxy.tools.console import flowdetailview from mitmproxy.tools.console import grideditor from mitmproxy.tools.console import searchable from mitmproxy.tools.console import signals from mitmproxy.tools.console import tabs -from mitmproxy import export -from mitmproxy.net.http import Headers -from mitmproxy.net.http import status_codes -from functools import lru_cache class SearchError(Exception): @@ -483,9 +483,12 @@ class FlowView(tabs.Tabs): return self._view_nextprev_flow(self.view.index(flow) - 1, flow) def change_this_display_mode(self, t): - name = contentviews.get_by_shortcut(t).name - self.view.settings[self.flow][(self.tab_offset, "prettyview")] = name - signals.flow_change.send(self, flow = self.flow) + view = contentviews.get_by_shortcut(t) + if view: + self.view.settings[self.flow][(self.tab_offset, "prettyview")] = view.name + else: + self.view.settings[self.flow][(self.tab_offset, "prettyview")] = None + signals.flow_change.send(self, flow=self.flow) def keypress(self, size, key): conn = None # type: Optional[Union[http.HTTPRequest, http.HTTPResponse]] |