Repository: mitmproxy/mitmproxy

Issue:
Entering Palette options crashes mitmproxy
##### Steps to reproduce the problem:

1. Press 'O' for options
2. Select 'Palette'
3. mitmproxy will crash


##### Any other comments? What have you tried so far?
```
Traceback (most recent call last):
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/mitmproxy/tools/console/master.py", line 281, in run
    self.loop.run()
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 278, in run
    self._run()
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 376, in _run
    self.event_loop.run()
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 682, in run
    self._loop()
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 719, in _loop
    self._watch_files[fd]()
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/raw_display.py", line 393, in <lambda>
    event_loop, callback, self.get_available_raw_input())
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/raw_display.py", line 493, in parse_input
    callback(processed, processed_codes)
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 403, in _update
    self.process_input(keys)
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/main_loop.py", line 503, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/mitmproxy/tools/console/window.py", line 84, in keypress
    k = super().keypress(size, k)
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/container.py", line 1128, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/urwid/container.py", line 1128, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/mitmproxy/tools/console/select.py", line 114, in keypress
    self.get_focus()[0].option.activate()
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/mitmproxy/tools/console/palettepicker.py", line 46, in <lambda>
    lambda: setattr(self.master.options, "palette", name)
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/mitmproxy/optmanager.py", line 114, in __setattr__
    self.update(**{attr: value})
  File "/usr/local/Cellar/mitmproxy/2.0.0/libexec/lib/python3.6/site-packages/mitmproxy/optmanager.py", line 141, in update
    raise KeyError("No such option: %s" % k)
KeyError: 'No such option: palette'

```
The option names in mitmproxy/options.py were prefixed with 'console_', but line 46 and line 62  of mitmproxy/tools/console/palettepicker.py were not updated to include this prefix. 

This appears to have been broken by commit [35aff3b](https://github.com/mitmproxy/mitmproxy/commit/35aff3b7838f8df718cc574d2643f1355849fa8e)

##### System information

Mitmproxy version: 2.0.0 (release version) 
Python version: 3.6.0
Platform: Darwin-16.4.0-x86_64-i386-64bit
SSL version: OpenSSL 1.1.0e  16 Feb 2017
Mac version: 10.12.3 ('', '', '') x86_64



Discussion:

Resolving patch:
diff --git a/mitmproxy/tools/console/palettepicker.py b/mitmproxy/tools/console/palettepicker.py
--- a/mitmproxy/tools/console/palettepicker.py
+++ b/mitmproxy/tools/console/palettepicker.py
@@ -43,7 +43,7 @@ def mkopt(name):
                 i,
                 None,
                 lambda: self.master.options.console_palette == name,
-                lambda: setattr(self.master.options, "palette", name)
+                lambda: setattr(self.master.options, "console_palette", name)
             )
 
         for i in high:
@@ -59,7 +59,7 @@ def mkopt(name):
                     "Transparent",
                     "T",
                     lambda: master.options.console_palette_transparent,
-                    master.options.toggler("palette_transparent")
+                    master.options.toggler("console_palette_transparent")
                 )
             ]
         )


Test patch: