def database_conf(db_path, prefix='GALAXY'):
 database_auto_migrate = False
 dburi_var = ('%s_TEST_DBURI' % prefix)
 if (dburi_var in os.environ):
  database_connection = os.environ[dburi_var]
 else:
  default_db_filename = ('%s.sqlite' % prefix.lower())
  template_var = ('%s_TEST_DB_TEMPLATE' % prefix)
  db_path = os.path.join(db_path, default_db_filename)
  if (template_var in os.environ):
   copy_database_template(os.environ[template_var], db_path)
   database_auto_migrate = True
  database_connection = ('sqlite:///%s' % db_path)
 config = {'database_connection': database_connection, 'database_auto_migrate': database_auto_migrate}
 if (not database_connection.startswith('sqlite://')):
  config['database_engine_option_max_overflow'] = '20'
  config['database_engine_option_pool_size'] = '10'
 return config

def database_conf ( db_path , prefix = 'GALAXY' ) : database_auto_migrate = False dburi_var = ( '%s_TEST_DBURI' % prefix ) if ( dburi_var in os . environ ) : database_connection = os . environ [ dburi_var ] else : default_db_filename = ( '%s.sqlite' % prefix . lower ( ) ) template_var = ( '%s_TEST_DB_TEMPLATE' % prefix ) db_path = os . path . join ( db_path , default_db_filename ) if ( template_var in os . environ ) : copy_database_template ( os . environ [ template_var ] , db_path ) database_auto_migrate = True database_connection = ( 'sqlite:///%s' % db_path ) config = { 'database_connection' : database_connection , 'database_auto_migrate' : database_auto_migrate } if ( not database_connection . startswith ( 'sqlite://' ) ) : config [ 'database_engine_option_max_overflow' ] = '20' config [ 'database_engine_option_pool_size' ] = '10' return config
find galaxy database connection .