Catch CTRL+c in new_system_setup.py

Fixes issue #50
This commit is contained in:
2Shirt 2019-02-23 18:07:49 -07:00
parent 85212fb171
commit 054cf25811
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -87,9 +87,13 @@ if __name__ == '__main__':
function=install_ninite_bundle, cs='Started', function=install_ninite_bundle, cs='Started',
mse=answer_mse, libreoffice=answer_libreoffice, mse=answer_mse, libreoffice=answer_libreoffice,
other_results=other_results) other_results=other_results)
for proc in result['Out']: try:
# Wait for all processes to finish for proc in result['Out']:
proc.wait() # Wait for all processes to finish
print_standard('Waiting for installations to finish...')
proc.wait()
except KeyboardInterrupt:
pass
# Scan for supported browsers # Scan for supported browsers
print_info('Scanning for browsers') print_info('Scanning for browsers')
@ -108,7 +112,14 @@ if __name__ == '__main__':
# Configure software # Configure software
print_info('Configuring programs') print_info('Configuring programs')
install_adblock() print_standard(' (if stuck press CTRL+c to cancel this step).')
try:
install_adblock()
except KeyboardInterrupt:
print_warning('Configuration interrupted.')
print_standard('Please confirm all browsers have adblock installed.')
if not ask('Continue to next step?'):
abort()
if global_vars['OS']['Version'] == '10': if global_vars['OS']['Version'] == '10':
try_and_print(message='ClassicStart...', try_and_print(message='ClassicStart...',
function=config_classicstart, cs='Done') function=config_classicstart, cs='Done')