(self)
Loop over databases.
Loop over databases.
Loop over databases .
def work(self):
        """Loop over databases."""

        self.set_single_loop(1)

        self.load_cur_versions()

        # loop over all dbs
        dblst = self.args
        if self.options.all:
            db = self.connect_db('postgres')
            curs = db.cursor()
            curs.execute(DB_LIST)
            dblst = []
            for row in curs.fetchall():
                dblst.append(row[0])
            self.close_database('db')
        elif not dblst:
            raise skytools.UsageError('Give --all or list of database names on command line')

        # loop over connstrs
        for dbname in dblst:
            if self.last_sigint:
                break
            self.log.info("%s: connecting", dbname)
            db = self.connect_db(dbname)
            self.upgrade(dbname, db)
            self.close_database('db')
def work ( self ) : self . set_single_loop ( 1 ) self . load_cur_versions ( ) # loop over all dbs dblst = self . args if self . options . all : db = self . connect_db ( 'postgres' ) curs = db . cursor ( ) curs . execute ( DB_LIST ) dblst = [ ] for row in curs . fetchall ( ) : dblst . append ( row [ 0 ] ) self . close_database ( 'db' ) elif not dblst : raise skytools . UsageError ( 'Give --all or list of database names on command line' ) # loop over connstrs for dbname in dblst : if self . last_sigint : break self . log . info ( "%s: connecting" , dbname ) db = self . connect_db ( dbname ) self . upgrade ( dbname , db ) self . close_database ( 'db' )