Ejemplo n.º 1
0
    def complete_raise_error(self, cmd: Cmd, text: str, line: str, begidx: int, endidx: int) -> List[str]:
        """
        CompletionErrors can be raised if an error occurs while tab completing.

        Example use cases
            - Reading a database to retrieve a tab completion data set failed
            - A previous command line argument that determines the data set being completed is invalid
        """
        raise CompletionError("This is how a CompletionError behaves")
Ejemplo n.º 2
0
 def choices_completion_error(self) -> List[str]:
     """
     CompletionErrors can be raised if an error occurs while tab completing.
     Example use cases
         - Reading a database to retrieve a tab completion data set failed
         - A previous command line argument that determines the data set being completed is invalid
     """
     if self.debug:
         return self.sport_item_strs
     raise CompletionError("debug must be true")
Ejemplo n.º 3
0
 def choice_raise_error(self) -> List[str]:
     """Raises CompletionError"""
     raise CompletionError('choice broke something')
Ejemplo n.º 4
0
 def completer_raise_error(self, text: str, line: str, begidx: int, endidx: int) -> List[str]:
     """Raises CompletionError"""
     raise CompletionError('completer broke something')