Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
 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)
Пример #4
0
def interrupt():
    clear_readline()
    print('Interrupting cow -- moo!')
    readline.redisplay(True)
    Timer(2, interrupt).start()
Пример #5
0
 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)
Пример #6
0
def display(message):
    clear_readline()
    print(message)
    readline.redisplay(True)