Пример #1
0
def launch(form, entry_filename, file_format, rec_format, output_ID, master):

    main.check_file_name(form, entry_filename)
    #popup_en_cours = main.message_programme_en_cours(form)

    if (rec_format == 1):
        for doct in doctype:
            for recordt in recordtype:
                dcrec = doct + recordt
                doct_libelle = doct
                if (doct in doctype):
                    doct_libelle = doctype[doct]
                recordt_libelle = recordt
                if (recordt in recordtype):
                    recordt_libelle = recordtype[recordt]
                dcrec_libelles = "-".join([doct_libelle, recordt_libelle])
                doc_record_type[dcrec] = dcrec_libelles
    else:
        doct = "c"
        for recordt in recordtypeAUT:
            dcrec = doct + recordt
            doct_libelle = doct
            if (doct in doctypeAUT):
                doct_libelle = doctypeAUT[doct]
            recordt_libelle = recordt
            if (recordt in recordtypeAUT):
                recordt_libelle = recordtypeAUT[recordt]
            dcrec_libelles = "-".join([doct_libelle, recordt_libelle])
            doc_record_type[dcrec] = dcrec_libelles
    print("Fichier en entrée : ", entry_filename)
    if (file_format == 1 or file_format == 3):
        iso2tables(master, entry_filename, file_format, rec_format, output_ID)
    else:
        xml2tables(master, entry_filename, rec_format, output_ID)
    end_of_treatments(form, output_ID)
Пример #2
0
def launch(form, entry_filename, file_format, output_ID, master):
    main.check_file_name(form, entry_filename)
    print("Fichier en entrée : ", entry_filename)
    if (file_format == 1):
        iso2tables(master, entry_filename, output_ID)
    else:
        xml2tables(master, entry_filename, output_ID)
    end_of_treatments(form, output_ID)
Пример #3
0
def launch(entry_filename,
           file_format,
           rec_format,
           output_ID,
           master=None,
           form=None):
    """Lancement du programme après validation
    du formulaire de conversion d 'un fichier MARC en tableaux"""
    if entry_filename == []:
        main.popup_errors(form, "Merci d'indiquer un nom de fichier en entrée")
        raise
    else:
        entry_filename = entry_filename[0]
    try:
        [entry_filename, file_format, rec_format, output_ID] = [
            str(entry_filename),
            int(file_format),
            int(rec_format),
            str(output_ID)
        ]
    except ValueError as err:
        print("\n\nDonnées en entrée erronées\n")
        print(err)
    main.check_file_name(form, entry_filename)
    # popup_en_cours = main.message_programme_en_cours(form)

    # Notices BIB : Type de document / type de notice
    if (rec_format == 1):
        for doct in doctype:
            for recordt in recordtype:
                dcrec = doct + recordt
                doct_libelle = doct
                if (doct in doctype):
                    doct_libelle = doctype[doct]
                recordt_libelle = recordt
                if (recordt in recordtype):
                    recordt_libelle = recordtype[recordt]
                dcrec_libelles = "-".join([doct_libelle, recordt_libelle])
                doc_record_type[dcrec] = dcrec_libelles
    # Notices AUT : type d'autorité
    else:
        doct = "c"
        for recordt in recordtypeAUT:
            dcrec = doct + recordt
            doct_libelle = doct
            if (doct in doctypeAUT):
                doct_libelle = doctypeAUT[doct]
            recordt_libelle = recordt
            if (recordt in recordtypeAUT):
                recordt_libelle = recordtypeAUT[recordt]
            dcrec_libelles = "-".join([doct_libelle, recordt_libelle])
            doc_record_type[dcrec] = dcrec_libelles
    print("Fichier en entrée : ", entry_filename)
    if (file_format == 1 or file_format == 2):
        iso2tables(master, entry_filename, file_format, rec_format, output_ID)
    else:
        xml2tables(master, entry_filename, rec_format, output_ID)
    end_of_treatments(form, output_ID)
Пример #4
0
)

if my_hash == new_hash:
    print("hash matches")
else:
    print('hashes do not match')

try:

    pprint(your_datas[r"insert file name"])
except:
    file_path = r'insert file name'
    file_hash = md5_hash(file_path)
    file_size = check_size(file_path)
    file_type = check_file_type(file_path)
    file_name = check_file_name(file_path)
    digital_signature = get_digital_signature(file_path)
    with open('all_your_datas.json') as json_file:
        data = json.load(json_file)

        temp = data

        y = {
            r'insert file name': {
                'file_name': file_name,
                'file_type': file_type,
                'file_hash': file_hash,
                'file_size': file_size,
                'digital_signature': digital_signature
            }
        }