Exemple #1
0
def submit_fixmarc_task(recids):
    """Submit a task that synchronizes the 8564 tags

    This should be done right after changing the files attached to a record"""
    field = [{'doctype': 'FIX-MARC'}]
    ffts = {}
    for recid in recids:
        ffts[recid] = field
    bibupload_ffts(ffts, append=False, interactive=False)
def submit_fixmarc_task(recids):
    """Submit a task that synchronizes the 8564 tags

    This should be done right after changing the files attached to a record"""
    field = [{'doctype' : 'FIX-MARC'}]
    ffts = {}
    for recid in recids:
        ffts[recid] = field
    bibupload_ffts(ffts, append=False, interactive=False)
Exemple #3
0
def bst_fix_ffts(debug=0):
    debug = bool(int(debug))
    ffts = {}
    for recid in get_broken_recids():
        task_sleep_now_if_required(can_stop_too=True)
        write_message("Fixing %s" % recid)
        try:
            ffts[recid] = build_fft(get_last_pdf_for_record(BibRecDocs(recid)))
        except:
            register_exception(alert_admin=True)
    write_message("Uploading corrections")
    bibupload_ffts(ffts, append=True, do_debug=debug, interactive=False)
    return True
Exemple #4
0
def bst_fix_ffts(debug=0):
    debug = bool(int(debug))
    ffts = {}
    for recid in get_broken_recids():
        task_sleep_now_if_required(can_stop_too=True)
        write_message("Fixing %s" % recid)
        try:
            ffts[recid] = build_fft(get_last_pdf_for_record(BibRecDocs(recid)))
        except:
            register_exception(alert_admin=True)
    write_message("Uploading corrections")
    bibupload_ffts(ffts, append=True, do_debug=debug, interactive=False)
    return True
def upload_file(ffts, append=True):
    try:
        sys.argv.append('--yes-i-know')
        out = bibdocfilecli.bibupload_ffts(ffts, append=append, debug=False)
    finally:
        sys.argv.pop(-1)
        ffts.clear()