Commit bbc6973c by Tu Nombre

Base de reporte nuebo

1 parent a4475330
...@@ -8,3 +8,4 @@ delataPositivoNegativo = "-" ...@@ -8,3 +8,4 @@ delataPositivoNegativo = "-"
ManualLogin = False # PAra hacer pruebas sin tener que loguear ManualLogin = False # PAra hacer pruebas sin tener que loguear
port = 13000 port = 13000
codigo_cent = "50" codigo_cent = "50"
reporte_defecto = "repo.doc"
{
"1":{
"N1":{
"2":"reporte_prueba.doc",
"3":""
},
"M1":{
"2":"",
"3":""
},
"N2":{
"2":"",
"3":""
},
"M2":{
"2":"",
"3":""
},
"N3":{
"2":"",
"3":""
},
"M3":{
"2":"",
"3":""
},
"O1":{
"2":"",
"3":"",
"4":""
},
"O2":{
"2":"",
"3":"",
"4":""
},
"O3":{
"2":"",
"3":"",
"4":""
},
"O4":{
"2":"",
"3":"",
"4":""
},
"UP":{
"2":"",
"3":"",
"4":""
}
},
"2":{
"N1":{
"2":"",
"3":""
},
"M1":{
"2":"",
"3":""
},
"N2":{
"2":"",
"3":""
},
"M2":{
"2":"",
"3":""
},
"N3":{
"2":"",
"3":""
},
"M3":{
"2":"",
"3":""
},
"O1":{
"2":"",
"3":"",
"4":""
},
"O2":{
"2":"",
"3":"",
"4":""
},
"O3":{
"2":"",
"3":"",
"4":""
},
"O4":{
"2":"",
"3":"",
"4":""
},
"UP":{
"2":"",
"3":"",
"4":""
}},
"3":{
"N1":{
"2":"",
"3":""
},
"M1":{
"2":"",
"3":""
},
"N2":{
"2":"",
"3":""
},
"M2":{
"2":"",
"3":""
},
"N3":{
"2":"",
"3":""
},
"M3":{
"2":"",
"3":""
},
"O1":{
"2":"",
"3":"",
"4":""
},
"O2":{
"2":"",
"3":"",
"4":""
},
"O3":{
"2":"",
"3":"",
"4":""
},
"O4":{
"2":"",
"3":"",
"4":""
},
"UP":{
"2":"",
"3":"",
"4":""
}
}
}
...@@ -7,6 +7,7 @@ import configuracion, time ...@@ -7,6 +7,7 @@ import configuracion, time
from matematika import * from matematika import *
from titulos import * from titulos import *
import pruebas import pruebas
import reportes as Repo
class MyCustomException(Exception): class MyCustomException(Exception):
def __init__(self, message): def __init__(self, message):
...@@ -65,6 +66,15 @@ def protected_static(filename): ...@@ -65,6 +66,15 @@ def protected_static(filename):
else: else:
return abort(403) return abort(403)
@app.route('/reporte_doc', methods = ['POST'])
def consulta_reporte():
linea = request.json['linea']
tipo = request.json['tipo']
ejes = request.json['cantidadEjes']
return Repo.BuscarReporteDefecto(linea,tipo,ejes)
@app.route('/historico') @app.route('/historico')
def historico(): def historico():
if "login" not in request.cookies: if "login" not in request.cookies:
......
import json, configuracion
def BuscarReporteDefecto(linea,tipo,cantidadEjes=2):
linea = str(linea)
cantidadEjes = str(cantidadEjes)
tipo = tipo.upper()
with open("data/reportes.json", 'r') as f:
data = json.load(f)
try:
rta = data[linea][tipo][cantidadEjes]
except:
print(f"reporte defecto linea: {linea}, tipo: {tipo}, ejes {cantidadEjes}")
rta = configuracion.reporte_defecto
print(rta)
return rta
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!