diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-12-11 13:22:26 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-12-11 13:22:26 +0100 |
commit | bdba8859229db9349aa656ec2b9b9299e2e7dca2 (patch) | |
tree | 296f6a6073fc76cd90d145f29dd018a724c3d962 | |
parent | 402332708724797713630af7f41cc2cabd79898e (diff) | |
download | mitmproxy-bdba8859229db9349aa656ec2b9b9299e2e7dca2.tar.gz mitmproxy-bdba8859229db9349aa656ec2b9b9299e2e7dca2.tar.bz2 mitmproxy-bdba8859229db9349aa656ec2b9b9299e2e7dca2.zip |
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]] |