Ejemplo n.º 1
0
def iepgengine():
    """Recieves an Excel file and launches the IEPG calculation. Returns
    an Excel with the results."""

    file = request.files["file"]

    if file is not None and file.filename.rsplit(".",
                                                 1)[1] in ["xlsx", "XLSX"]:
        filename = hashlib.md5(str(time.time()) + session["email"]).hexdigest()
        path_filename = os.path.join(backend["tmpFolder"], filename + ".xlsx")
        outFileName = os.path.join(backend["tmpFolder"],
                                   hashlib.md5(str(time.time())+session["email"]+"outputIEPGEngine").hexdigest()+ \
                                   ".xlsx")
        file.save(path_filename)
        flux = Flux()
        flux.calculusFromXLSXToXLSX(path_filename, outFileName)

        return (send_file(
            outFileName,
            mimetype=
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
            attachment_filename="Real_Instituto_Elcano-Calculo_IEPG.xlsx",
            as_attachment=True))

    else:
        return jsonify({"Error": "Bad file."})
Ejemplo n.º 2
0
def iepgengine():
    """Recieves an Excel file and launches the IEPG calculation. Returns
    an Excel with the results."""
    
    file = request.files["file"]

    if file is not None and file.filename.rsplit(".",1)[1] in ["xlsx","XLSX"]:
        filename = hashlib.md5(str(time.time())+session["email"]).hexdigest()
        path_filename = os.path.join(backend["tmpFolder"], filename+".xlsx")
        outFileName = os.path.join(backend["tmpFolder"],
                                   hashlib.md5(str(time.time())+session["email"]+"outputIEPGEngine").hexdigest()+ \
                                   ".xlsx")
        file.save(path_filename)
        flux = Flux()
        flux.calculusFromXLSXToXLSX(path_filename,outFileName)

        return(send_file(outFileName, mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 
                     attachment_filename="Real_Instituto_Elcano-Calculo_IEPG.xlsx",
                     as_attachment=True))

    else:
        return jsonify({"Error": "Bad file."})
Ejemplo n.º 3
0
from common.flux import Flux

inputfilename = "data_calculus/year2015.xlsx"

Flux().calculusFromXLSXToWholeApplication(inputfilename)
Ejemplo n.º 4
0
from common.flux import Flux
inputfilename = "data_calculus/year2015.xlsx"

flux = Flux()

#flux.calculusFromXLSXToWholeApplication(inputfilename)

outputfilename = "data_calculus/calculus2015.xlsx"
flux.calculusFromXLSXToXLSX(inputfilename,outputfilename)
Ejemplo n.º 5
0
from common.flux import Flux
inputfilename = "data_calculus/year2015.xlsx"

flux = Flux()

#flux.calculusFromXLSXToWholeApplication(inputfilename)

outputfilename = "data_calculus/calculus2015.xlsx"
flux.calculusFromXLSXToXLSX(inputfilename, outputfilename)
Ejemplo n.º 6
0
from common.flux import Flux

Flux().updateRedisCache()