def crate_enabler(): try: if (not crate_disable.is_set()) & (not power.is_set()): lzamp.power_on() power.set() except (KeyboardInterrupt, SystemExit): raise except Exception: exception_traceback_log.exception('The following error occurred:') pass
if snum >= 0: print('\nSerial Number {:d} successfully written to board.\n'. format(snum)) serNums[slot - 1] = snum break elif ii < 5: print('\nUnable to write serial number to board, try again.\n') else: print('\nFatal error occurred, exiting\n') exit() if check_input_yn('\nAre green lights off on all amp boards? (y/n) '): print('fatal error, exiting.') exit() lzamp.power_on() if check_input_yn('\nAre green lights now lit on all amp boards? (y/n) '): print('fatal error, exiting.') exit() t = Thread(target=loop_AMP_heartbeat) t.start() sleep(1) if check_input_yn( '\nAre the red LEDs on the AMPs flashing in the correct order (1, 2, 3, 4)? (y/n) ' ): print('fatal error, exiting. AMPs were installed incorrectly.') event.set() t.join()