예제 #1
0
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
예제 #2
0
파일: app.py 프로젝트: syaffa/ilastik
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
예제 #3
0
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
예제 #4
0
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
예제 #5
0
    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))

    
예제 #6
0
파일: app.py 프로젝트: syaffa/ilastik
def _update_hbp_mode(parsed_args):
    """enable HBP-specific functionality"""
    if parsed_args.hbp:
        ilastik_config.set("ilastik", "hbp", "true")
예제 #7
0
def _update_hbp_mode(parsed_args):
    """enable HBP-specific functionality"""
    if parsed_args.hbp:
        ilastik_config.set('ilastik', 'hbp', 'true')
예제 #8
0
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)
예제 #9
0
def _update_hbp_mode(parsed_args):
    """enable HBP-specific functionality"""
    if parsed_args.hbp:
        ilastik_config.set('ilastik', 'hbp', 'true')