def _do_db_create():
 server = BioSeqDatabase.open_database(driver=DBDRIVER, host=DBHOST, user=DBUSER, passwd=DBPASSWD)
 if (DBDRIVER == 'pgdb'):
  server.adaptor.cursor.execute('COMMIT')
 else:
  try:
   server.adaptor.autocommit()
  except AttributeError:
   pass
 try:
  time.sleep(1)
  sql = ('DROP DATABASE ' + TESTDB)
  server.adaptor.cursor.execute(sql, ())
 except (server.module.OperationalError, server.module.Error, server.module.DatabaseError) as e:
  pass
 except (server.module.IntegrityError, server.module.ProgrammingError) as e:
  if (str(e).find(('database "%s" does not exist' % TESTDB)) == (-1)):
   server.close()
   raise
 sql = ('CREATE DATABASE ' + TESTDB)
 server.adaptor.execute(sql, ())
 server.close()

def _do_db_create ( ) : server = BioSeqDatabase . open_database ( driver = DBDRIVER , host = DBHOST , user = DBUSER , passwd = DBPASSWD ) if ( DBDRIVER == 'pgdb' ) : server . adaptor . cursor . execute ( 'COMMIT' ) else : try : server . adaptor . autocommit ( ) except AttributeError : pass try : time . sleep ( 1 ) sql = ( 'DROP DATABASE ' + TESTDB ) server . adaptor . cursor . execute ( sql , ( ) ) except ( server . module . OperationalError , server . module . Error , server . module . DatabaseError ) as e : pass except ( server . module . IntegrityError , server . module . ProgrammingError ) as e : if ( str ( e ) . find ( ( 'database "%s" does not exist' % TESTDB ) ) == ( - 1 ) ) : server . close ( ) raise sql = ( 'CREATE DATABASE ' + TESTDB ) server . adaptor . execute ( sql , ( ) ) server . close ( )
do the actual work of database creation .