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 82115599
authored
2023-09-05 15:43:11 -0300
by
Juan Pablo dure
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Se termina integracion antes de pruebas
1 parent
a03e6b39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
6 deletions
ingenieros.py
ingenieros.py
View file @
8211559
...
...
@@ -9,9 +9,9 @@ class ingenieros():
def
__init__
(
self
)
->
None
:
self
.
Archivo
=
"data/ingenieros.json"
self
.
cache
=
{}
a
=
datetime
.
datetime
.
now
()
self
.
delta
=
datetime
.
timedelta
(
seconds
=
100
)
self
.
_last_update
=
a
#- self.delta
self
.
_last_update
=
datetime
.
datetime
.
now
()
#- self.delta
self
.
LeerArchivo
(
force
=
True
)
def
CacheVencido
(
self
):
a
=
datetime
.
datetime
.
now
()
...
...
@@ -21,13 +21,34 @@ class ingenieros():
def
LeerDatosUsuario
(
self
,
usuario
):
"""Lee los datos de un usuario desde el cache si el tiempo
no excede el delta"""
rta
=
{}
try
:
rta
=
self
.
LeerArchivo
()[
usuario
]
except
Exception
as
E
:
print
(
E
)
rta
=
{
"nombreyapellido"
:
"Usuario no cargado"
,
"matricula"
:
""
}
return
rta
def
LeerArchivo
(
self
,
force
=
False
):
if
self
.
CacheVencido
()
or
force
:
with
open
(
self
.
Archivo
)
as
file
:
data
=
json
.
load
(
file
)
self
.
cache
=
data
self
.
_last_update
=
datetime
.
datetime
.
now
()
else
:
data
=
self
.
cache
return
data
if
__name__
==
"__main__"
:
ing
=
ingenieros
()
for
n
in
range
(
0
,
110
):
print
(
ing
.
CacheVencido
())
print
(
apollo
.
estaticos
.
FechaHora
())
print
(
apollo
.
estaticos
.
FechaHora
())
for
n
in
range
(
0
,
125
):
apollo
.
estaticos
.
FechaHora
()
print
(
ing
.
LeerDatosUsuario
(
usuario
=
"user"
))
print
(
ing
.
LeerDatosUsuario
(
usuario
=
"usfsder"
))
#print(ing.cache)
#print(ing.LeerArchivo())
if
ing
.
CacheVencido
():
print
(
apollo
.
estaticos
.
FechaHora
())
quit
()
time
.
sleep
(
1
)
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