Пример #1
0
def get_db_info():
    config_file = mc_config.read_config()

    db_infos = config_file['database']
    db_info = next(db_info for db_info in db_infos
                   if db_info['port'] == '6000')
    return db_info
Пример #2
0
def get_solr_collection_url_prefix():
    config = mc_config.read_config()

    #print >> sys.stderr, config

    solr_collection_url = config['mediawords'][ 'solr_url' ][0] + '/collection1'

    return solr_collection_url
Пример #3
0
def get_solr_collection_url_prefix():
    config = mc_config.read_config()

    #print >> sys.stderr, config

    solr_collection_url = config['mediawords']['solr_url'][0] + '/collection1'

    return solr_collection_url
Пример #4
0
def get_db_info(db_label=None):
    config_file = mc_config.read_config()

    databases = config_file['database']

    if db_label is not None:
        databases = [db for db in databases if db['label'] == db_label]

    ret = databases[0]

    return ret
def get_db_info( db_label=None):
    config_file = mc_config.read_config()

    databases = config_file['database']

    if db_label is not None:
        databases = [ db for db in databases if db['label'] == db_label ]

    ret = databases[ 0 ]

    return ret
Пример #6
0
def get_solr_collection_url_prefix():
    config = mc_config.read_config()

    #print >> sys.stderr, config

    solr_select_url = config['mediawords'][ 'solr_select_url' ]

    assert solr_select_url.endswith( '/select')

    solr_collection_url = solr_select_url[:-7]

    return solr_collection_url
Пример #7
0
def get_db_info():
    config_file = mc_config.read_config()
    return config_file['database'][0]
def get_db_info():
    config_file = mc_config.read_config()
    
    db_infos = config_file['database']
    db_info = next (db_info for db_info in db_infos if db_info['port'] == '6000' )
    return db_info
Пример #9
0
def get_db_info():
    config_file = mc_config.read_config()
    return config_file['database'][0]