예제 #1
0
파일: cli.py 프로젝트: agbeltran/hepdata
def load(inspireids, tweet, convert, base_url):
    """Load records given their INSPIRE IDs into the database."""
    processed_record_ids = parse_inspireids_from_string(inspireids)

    load_files(processed_record_ids,
               send_tweet=tweet,
               convert=convert,
               base_url=base_url)
예제 #2
0
파일: cli.py 프로젝트: HEPData/hepdata3
def load(inspireids, tweet):
    """
    Remove records given their HEPData IDs from the database.
    Removes all database entries, leaves the files on the server.
    :param inspireids: list of record IDs to load
    :return:
    """
    processed_record_ids = parse_inspireids_from_string(inspireids)

    load_files(processed_record_ids, send_tweet=tweet)
예제 #3
0
파일: cli.py 프로젝트: drjova/hepdata
def populate(inspireids, recreate_index, tweet, convert):
    """
    Populate the DB with records.

    Usage: ``hepdata migrator populate -i 'ins1262703' -rc False -t False -c False``
    """
    from hepdata.ext.elasticsearch.api import recreate_index as reindex

    if recreate_index:
        reindex()

    files_to_load = parse_inspireids_from_string(inspireids)
    load_files(files_to_load, send_tweet=tweet, convert=convert)
예제 #4
0
파일: cli.py 프로젝트: ruphy/hepdata
def load(inspireids, tweet, convert, base_url):
    """
    Load records given their Inspire IDs into the database.
    :param base_url: override default base URL
    :param convert:
    :param tweet:
    :param inspireids: list of record IDs to load
    """
    processed_record_ids = parse_inspireids_from_string(inspireids)

    load_files(processed_record_ids,
               send_tweet=tweet,
               convert=convert,
               base_url=base_url)
예제 #5
0
파일: cli.py 프로젝트: HEPData/hepdata3
def populate(inspireids, recreate_index, tweet):
    """Populate the DB with records.
        Usage: hepdata populate -i 'ins1262703' -rc False -t False
        :param inspireids:
        :param tweet:
        :param recreate_index:

    """
    from hepdata.ext.elasticsearch.api import recreate_index as reindex

    if recreate_index:
        reindex()

    files_to_load = parse_inspireids_from_string(inspireids)
    load_files(files_to_load, send_tweet=tweet)
예제 #6
0
파일: cli.py 프로젝트: drjova/hepdata
def migrate(missing, start, end, date=None):
    """Migrates all content from HEPData."""
    print(missing)
    if missing:
        inspire_ids = get_missing_records()
    else:
        inspire_ids = get_all_ids_in_current_system(date)

    print("Found {} inspire ids to load.".format(len(inspire_ids)))
    if start is not None:
        _slice = slice(int(start), end)
        inspire_ids = inspire_ids[_slice]
        print("Sliced, going to load {} records.".format(len(inspire_ids)))

    print(inspire_ids)

    load_files(inspire_ids)
예제 #7
0
파일: cli.py 프로젝트: HEPData/hepdata3
def migrate(start, end, date=None, missing_only=False):
    """
    Migrates all content from HEPData
    :return:
    """
    if missing_only:
        inspire_ids = get_missing_records()
    else:
        inspire_ids = get_all_ids_in_current_system(date)

    print("Found {} inspire ids to load.".format(len(inspire_ids)))
    if start is not None:
        _slice = slice(int(start), end)
        inspire_ids = inspire_ids[_slice]
        print("Sliced, going to load {} records.".format(len(inspire_ids)))
        print(inspire_ids)

    load_files(inspire_ids)
예제 #8
0
파일: conftest.py 프로젝트: drjova/hepdata
def load_default_data(app, identifiers):
    with app.app_context():
        to_load = [x["hepdata_id"] for x in identifiers]
        load_files(to_load, synchronous=True)
예제 #9
0
def load_default_data(app):
    with app.app_context():
        to_load = [x["hepdata_id"] for x in identifiers()]
        load_files(to_load, synchronous=True)