def _update_debug_mode(parsed_args): # Force debug mode if any of these flags are active. if parsed_args.debug or ilastik_config.getboolean('ilastik', 'debug'): # There are two places that debug mode can be checked. # Make sure both are set. ilastik_config.set('ilastik', 'debug', 'true') parsed_args.debug = True
def _update_debug_mode(parsed_args): # Force debug mode if any of these flags are active. if parsed_args.debug or ilastik_config.getboolean("ilastik", "debug"): # There are two places that debug mode can be checked. # Make sure both are set. ilastik_config.set("ilastik", "debug", "true") parsed_args.debug = True
def _update_debug_mode( parsed_args ): # Force debug mode if any of these flags are active. if parsed_args.debug \ or parsed_args.start_recording \ or parsed_args.playback_script \ or ilastik_config.getboolean('ilastik', 'debug'): # There are two places that debug mode can be checked. # Make sure both are set. ilastik_config.set('ilastik', 'debug', 'true') parsed_args.debug = True
def _update_debug_mode(parsed_args): # Force debug mode if any of these flags are active. if ( parsed_args.debug or parsed_args.start_recording or parsed_args.playback_script or ilastik_config.getboolean("ilastik", "debug") ): # There are two places that debug mode can be checked. # Make sure both are set. ilastik_config.set("ilastik", "debug", "true") parsed_args.debug = True
init_funcs.append(loadProject) onfinish = None if parsed_args.exit_on_success: onfinish = QApplication.quit if parsed_args.playback_script is not None: def play_recording(shell): player = EventPlayer(parsed_args.playback_speed) player.play_script(parsed_args.playback_script, onfinish) init_funcs.append( partial(play_recording) ) if parsed_args.exit_on_failure: old_excepthook = sys.excepthook def print_exc_and_exit(*args): old_excepthook(*args) sys.stderr.write("Exiting early due to an unhandled exception. See error output above.\n") QApplication.exit(1) sys.excepthook = print_exc_and_exit install_thread_excepthook() if parsed_args.debug: ilastik_config.set('ilastik', 'debug', 'true') if ilastik_config.getboolean("ilastik", "debug"): logger.info("Starting ilastik in debug mode.") sys.exit(startShellGui(None,*init_funcs))
def _update_hbp_mode(parsed_args): """enable HBP-specific functionality""" if parsed_args.hbp: ilastik_config.set("ilastik", "hbp", "true")
def _update_hbp_mode(parsed_args): """enable HBP-specific functionality""" if parsed_args.hbp: ilastik_config.set('ilastik', 'hbp', 'true')
if parsed_args.playback_script is not None: # Auto-exit on success? onfinish = None if parsed_args.exit_on_success: onfinish = QApplication.quit parsed_args.debug = True # Auto-enable debug mode def play_recording(shell): from ilastik.utility.gui.eventRecorder import EventPlayer player = EventPlayer(parsed_args.playback_speed) player.play_script(parsed_args.playback_script, onfinish) init_funcs.append( partial(play_recording) ) # Force debug mode if parsed_args.debug: ilastik_config.set('ilastik', 'debug', 'true') # Auto-exit on uncaught exceptions (useful for testing) if parsed_args.exit_on_failure: old_excepthook = sys.excepthook def print_exc_and_exit(*args): old_excepthook(*args) sys.stderr.write("Exiting early due to an unhandled exception. See error output above.\n") QApplication.exit(1) sys.excepthook = print_exc_and_exit install_thread_excepthook() # Show uncaught exceptions to the user (default behavior) elif not ilastik_config.getboolean('ilastik', 'debug') and not parsed_args.headless: old_excepthook = sys.excepthook def exception_dialog(*exc_info): old_excepthook(*exc_info)