Example #1
0
    def setup_db(self, gtdb_version):
        """Setup database."""

        # initialise the backend
        self.db = GenomeDatabase.GenomeDatabase(1, False)
        self.db.conn.MakePostgresConnection(gtdb_version)

        # login
        try:
            self.db.Login(None, False)
        except GenomeDatabaseError as e:
            self.db.conn.ClosePostgresConnection()
            ErrorReport(e.message + " The following error(s) were reported:\n")
            DumpDBErrors(self.db)
            sys.exit(-1)
Example #2
0
    def setup_db(self, threads):
        """Setup database."""
        
        self.logger.info('Make sure you are running against the correct GTDB database!')
        
        # initialise the backend
        self.db = GenomeDatabase.GenomeDatabase(threads, False)
        self.db.conn.MakePostgresConnection()

        # login
        try:
            self.db.Login(None, False)
        except GenomeDatabaseError as e:
            self.db.conn.ClosePostgresConnection()
            ErrorReport(e.message + " The following error(s) were reported:\n")
            DumpDBErrors(self.db)
            sys.exit(-1)