def cancel(self, prompt=False): """Update the shell to indicate a 'cancel'. :type prompt: boolean :param prompt: If True, force a redraw of the prompt & line. """ self.stdout.write(str(" ^C") + "\n") readline.replace_line("") if prompt: readline.redisplay(True)
def redisplay(self, force=False): """Update the screen to reflect the current contents of :attr:`~rl.Completion.line_buffer`. If ``force`` is True, readline redisplays the prompt area as well as the line.""" readline.redisplay(force)
def interrupt(): clear_readline() print('Interrupting cow -- moo!') readline.redisplay(True) Timer(2, interrupt).start()
def display(message): clear_readline() print(message) readline.redisplay(True)