Example #1
0
 def __init__(self, ps1='>>> ', ps2='... ', show_js=False, libdir=None):
     Thread.__init__(self, name='RapydScriptREPL')
     self.to_python = to_python
     self.JSError = JSError
     self.enc = getattr(sys.stdin, 'encoding', None) or 'utf-8'
     try:
         import readline
         self.readline = readline
     except ImportError:
         pass
     self.output = ANSIStream(sys.stdout)
     self.to_repl = Queue()
     self.from_repl = Queue()
     self.ps1, self.ps2 = ps1, ps2
     self.show_js, self.libdir = show_js, libdir
     self.prompt = ''
     self.completions = None
     self.start()
Example #2
0
 def print_version(self, file=None):
     from calibre.utils.terminal import ANSIStream
     s = ANSIStream(file)
     optparse.OptionParser.print_version(self, file=s)
Example #3
0
 def print_help(self, file=None):
     from calibre.utils.terminal import ANSIStream
     s = ANSIStream(file)
     _OptionParser.print_help(self, file=s)