diff options
author | Aldo Cortesi <aldo@corte.si> | 2018-05-26 10:51:24 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-26 10:51:24 +1200 |
commit | 8a76970944e8f51ba21325bac2d170803730f440 (patch) | |
tree | d4f0555f5d702fe5e14a0770bf19ab996aecaec3 | |
parent | 7991c9e9b41bc1dcefbcdefdbe83cc61f58f30a8 (diff) | |
parent | bd7069a9e09f8c07add66576b165095acce4dea5 (diff) | |
download | mitmproxy-8a76970944e8f51ba21325bac2d170803730f440.tar.gz mitmproxy-8a76970944e8f51ba21325bac2d170803730f440.tar.bz2 mitmproxy-8a76970944e8f51ba21325bac2d170803730f440.zip |
Merge pull request #3157 from gcmurphy/issue/3147
Adjust options when changed
-rw-r--r-- | mitmproxy/optmanager.py | 1 | ||||
-rw-r--r-- | mitmproxy/tools/console/options.py | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/mitmproxy/optmanager.py b/mitmproxy/optmanager.py index a473e9df..2a4beba9 100644 --- a/mitmproxy/optmanager.py +++ b/mitmproxy/optmanager.py @@ -107,6 +107,7 @@ class OptManager: choices: typing.Optional[typing.Sequence[str]] = None ) -> None: self._options[name] = _Option(name, typespec, default, help, choices) + self.changed.send(self, updated={name}) @contextlib.contextmanager def rollback(self, updated, reraise=False): diff --git a/mitmproxy/tools/console/options.py b/mitmproxy/tools/console/options.py index 54772cf0..6e1399ce 100644 --- a/mitmproxy/tools/console/options.py +++ b/mitmproxy/tools/console/options.py @@ -106,6 +106,8 @@ class OptionListWalker(urwid.ListWalker): self.master.options.changed.connect(self.sig_mod) def sig_mod(self, *args, **kwargs): + self.opts = sorted(self.master.options.keys()) + self.maxlen = max(len(i) for i in self.opts) self._modified() self.set_focus(self.index) |