(self, intro=None)
Runs the main interactive command loop.

        :param intro: Initial text banner to display instead of the
           default.  Make sure you newline terminate it.
Runs the main interactive command loop.
Runs the main interactive command loop .
def cmdloop(self, intro=None):
        """Runs the main interactive command loop.

        :param intro: Initial text banner to display instead of the
           default.  Make sure you newline terminate it.
        """
        if intro is None:
            intro = """
SQLite version %s (APSW %s)
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
""" % (apsw.sqlitelibversion(), apsw.apswversion())
            intro = intro.lstrip()
        if self.interactive and intro:
            if sys.version_info < (3, 0):
                intro = unicode(intro)
            c = self.colour
            self.write(self.stdout, c.intro + intro + c.intro_)

        using_readline = False
        try:
            if self.interactive and self.stdin is sys.stdin:
                import readline
                old_completer = readline.get_completer()
                readline.set_completer(self.complete)
                readline.parse_and_bind("tab: complete")
                using_readline = True
                try:
                    readline.read_history_file(os.path.expanduser(self.history_file))
                except:
                    # We only expect IOError here but if the history
                    # file does not exist and this code has been
                    # compiled into the module it is possible to get
                    # an IOError that doesn't match the IOError from
                    # Python parse time resulting in an IOError
                    # exception being raised.  Consequently we just
                    # catch all exceptions.
                    pass
        except ImportError:
            pass

        try:
            while True:
                self._input_descriptions = []
                if using_readline:
                    # we drop completion cache because it contains
                    # table and column names which could have changed
                    # with last executed SQL
                    self._completion_cache = None
                    self._using_readline = True
                try:
                    command = self.getcompleteline()
                    if command is None:  # EOF
                        return
                    self.process_complete_line(command)
                except:
                    self._append_input_description()
                    try:
                        self.handle_exception()
                    except UnicodeDecodeError:
                        self.handle_exception()
        finally:
            if using_readline:
                readline.set_completer(old_completer)
                readline.set_history_length(256)
                readline.write_history_file(os.path.expanduser(self.history_file))
def cmdloop ( self , intro = None ) : if intro is None : intro = """
SQLite version %s (APSW %s)
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
""" % ( apsw . sqlitelibversion ( ) , apsw . apswversion ( ) ) intro = intro . lstrip ( ) if self . interactive and intro : if sys . version_info < ( 3 , 0 ) : intro = unicode ( intro ) c = self . colour self . write ( self . stdout , c . intro + intro + c . intro_ ) using_readline = False try : if self . interactive and self . stdin is sys . stdin : import readline old_completer = readline . get_completer ( ) readline . set_completer ( self . complete ) readline . parse_and_bind ( "tab: complete" ) using_readline = True try : readline . read_history_file ( os . path . expanduser ( self . history_file ) ) except : # We only expect IOError here but if the history # file does not exist and this code has been # compiled into the module it is possible to get # an IOError that doesn't match the IOError from # Python parse time resulting in an IOError # exception being raised.  Consequently we just # catch all exceptions. pass except ImportError : pass try : while True : self . _input_descriptions = [ ] if using_readline : # we drop completion cache because it contains # table and column names which could have changed # with last executed SQL self . _completion_cache = None self . _using_readline = True try : command = self . getcompleteline ( ) if command is None : # EOF return self . process_complete_line ( command ) except : self . _append_input_description ( ) try : self . handle_exception ( ) except UnicodeDecodeError : self . handle_exception ( ) finally : if using_readline : readline . set_completer ( old_completer ) readline . set_history_length ( 256 ) readline . write_history_file ( os . path . expanduser ( self . history_file ) )