(self, dbname)
return self.get_database('db', connstr = cstr, autocommit = 1)
Create connect string, then connect.
Create connect string, then connect.
Create connect string then connect .
def connect_db(self, dbname):
        """Create connect string, then connect."""

        elems = ["dbname='%s'" % dbname]
        if self.options.host:
            elems.append("host='%s'" % self.options.host)
        if self.options.port:
            elems.append("port='%s'" % self.options.port)
        if self.options.user:
            elems.append("user='%s'" % self.options.user)
        cstr = ' '.join(elems)
        return self.get_database('db', connstr = cstr, autocommit = 1)
def connect_db ( self , dbname ) : elems = [ "dbname='%s'" % dbname ] if self . options . host : elems . append ( "host='%s'" % self . options . host ) if self . options . port : elems . append ( "port='%s'" % self . options . port ) if self . options . user : elems . append ( "user='%s'" % self . options . user ) cstr = ' ' . join ( elems ) return self . get_database ( 'db' , connstr = cstr , autocommit = 1 )