예제 #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)
예제 #2
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)
예제 #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
예제 #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
예제 #5
0
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()