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 3f5e999a
authored
2023-10-04 16:41:03 -0300
by
Juan Pablo dure
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
prueba de correccion de datos
1 parent
6369237d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
fosadiaria.py
main.py
fosadiaria.py
View file @
3f5e999
from
datetime
import
datetime
import
datetime
from
time
import
sleep
import
os
,
subprocess
from
configuracion
import
*
import
pandas
as
pd
date_format_cent
=
'
%
d/
%
m/
%
Y
%
H:
%
M'
hora_format_cent
=
'
%
H:
%
M'
class
FosaDiaria
():
"""Esta clase almacenara todos los datos de finalizacion de
una planilla de foza, se busca se baja el excel se abra
...
...
@@ -17,7 +20,7 @@ class FosaDiaria():
def
BuscarDatosDominio
(
self
,
dominio
,
selenium
,
dia
=
False
):
if
dia
==
False
:
now
=
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
dia
=
now
.
strftime
(
"
%
d/
%
m/
%
Y"
)
try
:
data
=
self
.
Cache
[
dia
][
dominio
]
...
...
@@ -30,10 +33,18 @@ class FosaDiaria():
except
Exception
as
E
:
print
(
f
"""Error al actualizar dominio {str(E)}"""
)
return
self
.
LimpiarData
(
d
ata
,
d
ominio
,
dia
)
return
self
.
LimpiarData
(
dominio
,
dia
)
def
LimpiarData
(
self
,
data
,
dominio
,
dia
):
return
(
data
)
def
LimpiarData
(
self
,
dominio
,
dia
):
"""Por ahora solo lo usa para extraer hora el resto lo descartp"""
try
:
data
=
self
.
Cache
[
dia
][
dominio
]
fin
=
data
[
"fin"
]
del
data
except
Exception
as
E
:
print
(
"Error al limpiar datos "
,
E
)
fin
=
datetime
.
datetime
.
strftime
(
hora_format_cent
)
return
(
fin
)
def
ActualizarDatosDominios
(
self
,
selenium
,
dia
):
self
.
BajarExcel
(
selenium
)
...
...
@@ -69,9 +80,12 @@ class FosaDiaria():
n
=
n
+
1
#arranco desde 0
print
(
self
.
Cache
)
def
CorreccionDeHora
(
self
,
fin
):
def
CorreccionDeHora
(
self
,
fin
,
dia
):
"""Hora de finalizacion menos 10 minutos"""
return
(
fin
)
strdatetime
=
f
"{dia} {fin}"
delta
=
datetime
.
timedelta
(
minutes
=
11
)
obj
=
datetime
.
datetime
.
strptime
(
strdatetime
,
date_format_cent
)
-
delta
return
obj
.
strftime
(
hora_format_cent
)
def
BajarExcel
(
self
,
selenium
):
...
...
main.py
View file @
3f5e999
...
...
@@ -179,7 +179,8 @@ def report():
except
:
s
.
driver
.
quit
()
return
f
"Error en el login"
FozaDiaria
.
BuscarDatosDominio
(
plate
.
upper
(),
selenium
=
s
)
fin
=
FozaDiaria
.
BuscarDatosDominio
(
plate
.
upper
(),
selenium
=
s
)
print
(
fin
)
try
:
answer
=
gototec
(
s
,
answer
)
except
:
...
...
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