Abort on KeyboardInterrupts
This commit is contained in:
parent
d2fb8250bc
commit
59fd85429c
2 changed files with 7 additions and 1 deletions
|
|
@ -88,6 +88,8 @@ BASE_MENUS = {
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
wk.repairs.win.run_auto_repairs(BASE_MENUS)
|
wk.repairs.win.run_auto_repairs(BASE_MENUS)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
wk.std.abort()
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
raise
|
raise
|
||||||
except: #pylint: disable=bare-except
|
except: #pylint: disable=bare-except
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ from wk.std import (
|
||||||
GenericWarning,
|
GenericWarning,
|
||||||
Menu,
|
Menu,
|
||||||
TryAndPrint,
|
TryAndPrint,
|
||||||
|
abort,
|
||||||
ask,
|
ask,
|
||||||
clear_screen,
|
clear_screen,
|
||||||
color_string,
|
color_string,
|
||||||
|
|
@ -397,7 +398,10 @@ def run_auto_repairs(base_menus):
|
||||||
for group, menu in menus.items():
|
for group, menu in menus.items():
|
||||||
if group in ('Main', 'Options'):
|
if group in ('Main', 'Options'):
|
||||||
continue
|
continue
|
||||||
run_group(group, menu)
|
try:
|
||||||
|
run_group(group, menu)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
abort()
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
end_session()
|
end_session()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue