(self)
Commit the current state and submit the load task for execution.

        Note
        ----
        Any existing pending task is canceled.
Commit the current state and submit the load task for execution.
Commit the current state and submit the load task for execution .
def commit(self):
        """
        Commit the current state and submit the load task for execution.

        Note
        ----
        Any existing pending task is canceled.
        """
        self.__committimer.stop()
        if self.__watcher is not None:
            self.__cancel_task()
        self.error()

        item = self.current_item()
        if item is None:
            return
        path = item.path()
        opts = item.options()
        if not isinstance(opts, Options):
            return

        task = state = TaskState()
        state.future = ...
        state.watcher = qconcurrent.FutureWatcher()
        state.progressChanged.connect(
            self.__set_read_progress, Qt.DirectConnection)

        def progress_(i, j):
            task.emitProgressChangedOrCancel(i, j)

        task.future = self.__executor.submit(
            clear_stack_on_cancel(load_csv),
            path, opts, progress_, self.compatibility_mode
        )
        task.watcher.setFuture(task.future)
        w = task.watcher
        w.done.connect(self.__handle_result)
        w.progress = state
        self.__watcher = w
        self.__set_running_state()
def commit ( self ) : self . __committimer . stop ( ) if self . __watcher is not None : self . __cancel_task ( ) self . error ( ) item = self . current_item ( ) if item is None : return path = item . path ( ) opts = item . options ( ) if not isinstance ( opts , Options ) : return task = state = TaskState ( ) state . future = ... state . watcher = qconcurrent . FutureWatcher ( ) state . progressChanged . connect ( self . __set_read_progress , Qt . DirectConnection ) def progress_ ( i , j ) : task . emitProgressChangedOrCancel ( i , j ) task . future = self . __executor . submit ( clear_stack_on_cancel ( load_csv ) , path , opts , progress_ , self . compatibility_mode ) task . watcher . setFuture ( task . future ) w = task . watcher w . done . connect ( self . __handle_result ) w . progress = state self . __watcher = w self . __set_running_state ( )