Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit bbc6973c
authored
2024-07-29 19:24:17 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Base de reporte nuebo
1 parent
a4475330
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
180 additions
and
0 deletions
configuracion.py
data/reportes.json
main.py
reportes.py
configuracion.py
View file @
bbc6973
...
@@ -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"
data/reportes.json
0 → 100644
View file @
bbc6973
{
"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"
:
""
}
}
}
main.py
View file @
bbc6973
...
@@ -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
:
...
...
reportes.py
0 → 100644
View file @
bbc6973
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
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment