(self, stdin=None, stdout=None, stderr=None, encoding="utf8", args=None, db=None)
Create instance, set defaults and do argument processing.
Create instance, set defaults and do argument processing.
Create instance set defaults and do argument processing .
def __init__(self, stdin=None, stdout=None, stderr=None, encoding="utf8", args=None, db=None):
        """Create instance, set defaults and do argument processing."""
        super(Shell, self).__init__()
        # The parameter doc has to be in main class doc as sphinx
        # ignores any described here
        self.exceptions = False
        self.history_file = "~/.sqlite_history"
        self._db = None
        self.dbfilename = None
        if db:
            self.db = db, db.filename
        else:
            self.db = None, None
        self.prompt = "sqlite> "
        self.moreprompt = "    ..> "
        self.separator = "|"
        self.bail = False
        self.echo = False
        self.timer = False
        self.header = False
        self.nullvalue = ""
        self.output = self.output_list
        self._output_table = self._fmt_sql_identifier("table")
        self.widths = []
        # do we truncate output in list mode?  (explain doesn't, regular does)
        self.truncate = True
        # a stack of previous outputs. turning on explain saves previous, off restores
        self._output_stack = []

        # other stuff
        self.set_encoding(encoding)
        if stdin is None: stdin = sys.stdin
        if stdout is None: stdout = sys.stdout
        if stderr is None: stderr = sys.stderr
        self.stdin = stdin
        self.stdout = stdout
        self._original_stdout = stdout
        self.stderr = stderr
        # we don't become interactive until the command line args are
        # successfully parsed and acted upon
        self.interactive = None
        # current colouring object
        self.command_colour()  # set to default
        self._using_readline = False
        self._input_stack = []
        self.input_line_number = 0
        self.push_input()
        self.push_output()
        self._input_descriptions = []

        if args:
            try:
                self.process_args(args)
            except:
                if len(self._input_descriptions):
                    self._input_descriptions.append("Processing command line arguments")
                self.handle_exception()
                raise

        if self.interactive is None:
            self.interactive = getattr(self.stdin, "isatty", False) and self.stdin.isatty() and getattr(
                self.stdout, "isatty", False) and self.stdout.isatty()
def __init__ ( self , stdin = None , stdout = None , stderr = None , encoding = "utf8" , args = None , db = None ) : super ( Shell , self ) . __init__ ( ) # The parameter doc has to be in main class doc as sphinx # ignores any described here self . exceptions = False self . history_file = "~/.sqlite_history" self . _db = None self . dbfilename = None if db : self . db = db , db . filename else : self . db = None , None self . prompt = "sqlite> " self . moreprompt = "    ..> " self . separator = "|" self . bail = False self . echo = False self . timer = False self . header = False self . nullvalue = "" self . output = self . output_list self . _output_table = self . _fmt_sql_identifier ( "table" ) self . widths = [ ] # do we truncate output in list mode?  (explain doesn't, regular does) self . truncate = True # a stack of previous outputs. turning on explain saves previous, off restores self . _output_stack = [ ] # other stuff self . set_encoding ( encoding ) if stdin is None : stdin = sys . stdin if stdout is None : stdout = sys . stdout if stderr is None : stderr = sys . stderr self . stdin = stdin self . stdout = stdout self . _original_stdout = stdout self . stderr = stderr # we don't become interactive until the command line args are # successfully parsed and acted upon self . interactive = None # current colouring object self . command_colour ( ) # set to default self . _using_readline = False self . _input_stack = [ ] self . input_line_number = 0 self . push_input ( ) self . push_output ( ) self . _input_descriptions = [ ] if args : try : self . process_args ( args ) except : if len ( self . _input_descriptions ) : self . _input_descriptions . append ( "Processing command line arguments" ) self . handle_exception ( ) raise if self . interactive is None : self . interactive = getattr ( self . stdin , "isatty" , False ) and self . stdin . isatty ( ) and getattr ( self . stdout , "isatty" , False ) and self . stdout . isatty ( )