def on_process_finished()

in scripts/ui/common.py [0:0]


def on_process_finished(parent, p_id):
    """Callback event handler for a process completing on the specified tab.

    Args:
        p_id (str): PID of completed process.
    """
    if not p_id or p_id.startswith("run"):
        parent.log_reader.remove_processes()
    else:
        parent.log_reader.remove_process(p_id)
    parent.refresh_data()

    if p_id.startswith("run") and "_export_" not in p_id:
        if "update_frame_names" in dir(parent):
            parent.update_frame_names()

        if "sync_with_s3" in dir(parent) and not parent.is_process_killed:
            if parent.parent.is_aws:
                parent.sync_with_s3()

    if len(parent.log_reader.get_processes()) == 0:
        # Re-enable UI elements
        switch_ui_elements_for_processing(parent, parent.log_reader.gb, True)

    # We may have data to enable other tabs
    if p_id.startswith("run"):
        [s.refresh_data() for s in parent.parent.sections if s != parent]

    if "update_run_button_text" in dir(parent):
        parent.update_run_button_text()

    parent.is_process_killed = False