Fix nyx crashing when failing to write torrc.
When nyx tries to write torrc and fails, the exception handling was broken :
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/starter.py", line 118, in main
nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/curses.py", line 217, in start
curses.wrapper(_wrapper)
File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/curses.py", line 215, in _wrapper
function()
File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/__init__.py", line 243, in draw_loop
keybinding.handle(key)
File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/panel/__init__.py", line 84, in handle
self._action()
File "/usr/local/lib/python3.5/dist-packages/nyx-2.0.4.dev0-py3.5.egg/nyx/panel/config.py", line 222, in _show_write_dialog
show_message('Unable to save configuration (%s)' % exc.strerror, HIGHLIGHT, max_wait = 2)
AttributeError: 'OperationFailed' object has no attribute 'strerror'
This commit patches this small bug, and add a more accurate exception handling for the save_conf call.
The commit can be found here : https://git.oudin.ml/Guinness/nyx/commit/8565384dc42b3f0faef027f890602b15513787be .
Trac:
Username: Guinness