Python readline 模块,GetOutputFile() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用readline.GetOutputFile()

项目:isf    作者:w3h    | 项目源码 | 文件源码
def pre_input(self, completefn):
        if self.raw_input:
            if HAVE_READLINE:
                import atexit
                self.old_completer = readline.get_completer()
                # Fix Bug #3129: Limit the history size to consume less memory
                readline.set_history_length(self.historysize)
                readline.set_completer(completefn)
                readline.parse_and_bind(self.completekey+": complete")
                try:
                    readline.read_history_file()
                except IOError:
                    pass
                atexit.register(readline.write_history_file)
                self.havecolor = True
                if mswindows and self.enablecolor:
                    self.cwrite = readline.GetOutputFile().write_color
                else:
                    self.cwrite = self.stdout.write
项目:shadowbroker-auto    作者:wrfly    | 项目源码 | 文件源码
def pre_input(self, completefn):
        if self.raw_input:
            if HAVE_READLINE:
                import atexit
                self.old_completer = readline.get_completer()
                # Fix Bug #3129: Limit the history size to consume less memory
                readline.set_history_length(self.historysize)   
                readline.set_completer(completefn)
                readline.parse_and_bind(self.completekey+": complete")
                try:
                    readline.read_history_file()
                except IOError:
                    pass
                atexit.register(readline.write_history_file)
                self.havecolor = True
                if mswindows and self.enablecolor:
                    self.cwrite = readline.GetOutputFile().write_color
                else:
                    self.cwrite = self.stdout.write
项目:isf    作者:w3h    | 项目源码 | 文件源码
def do_resizeconsole(self, line):
        try:
            import readline
            readline.GetOutputFile().size(width=90,height=65)
        except:
            pass
项目:shadowbroker-auto    作者:wrfly    | 项目源码 | 文件源码
def do_resizeconsole(self, line):
        try:
            import readline
            readline.GetOutputFile().size(width=90,height=65)
        except:
            pass