示例#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
文件: _completion.py 项目: tony/rl
 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
文件: console.py 项目: hpk42/p4p
def display(message):
    clear_readline()
    print(message)
    readline.redisplay(True)