def _on_completions_refreshed(self, new_completer):
        """Swap the completer object in cli with the newly created completer.
        """
        with self._completer_lock:
            self.completer = new_completer
            # When cli is first launched we call refresh_completions before
            # instantiating the cli object. So it is necessary to check if cli
            # exists before trying the replace the completer object in cli.
            if self.cli:
                self.cli.current_buffer.completer = new_completer

        if self.cli:
            # After refreshing, redraw the CLI to clear the statusbar
            # "Refreshing completions..." indicator
            self.cli.request_redraw()
def _on_completions_refreshed ( self , new_completer ) : with self . _completer_lock : self . completer = new_completer if self . cli : self . cli . current_buffer . completer = new_completer if self . cli : self . cli . request_redraw ( )
Swap the completer object in cli with the newly created completer.