Spaces:
Running
Running
Timing type fix
Browse files- globales.py +1 -1
- herramientas.py +8 -12
globales.py
CHANGED
@@ -2,7 +2,7 @@ import autenticacion
|
|
2 |
|
3 |
#previo = "Una fotografía de un plato blanco con "
|
4 |
#previo = "A photograph of a white plate with a visually appealing culinary dish of "
|
5 |
-
previo = "A pic of a white plate with
|
6 |
llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
7 |
|
8 |
#espacio = "black-forest-labs/FLUX.1-dev"
|
|
|
2 |
|
3 |
#previo = "Una fotografía de un plato blanco con "
|
4 |
#previo = "A photograph of a white plate with a visually appealing culinary dish of "
|
5 |
+
previo = "A pic of a white plate with just "
|
6 |
llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
7 |
|
8 |
#espacio = "black-forest-labs/FLUX.1-dev"
|
herramientas.py
CHANGED
@@ -111,30 +111,26 @@ def siEsDiaSiguienteRenueva():
|
|
111 |
|
112 |
# Extraer solo la fecha de los objetos datetime
|
113 |
fecha_registro = datetime_obj_1.date()
|
114 |
-
print("Primera extracción: ", fecha_registro)
|
115 |
fecha_actual = datetime_obj_2.date()
|
116 |
-
print("Segunda extracción: ", fecha_actual)
|
117 |
|
118 |
# Verificar si las fechas son diferentes
|
119 |
-
resultado = fecha_actual > fecha_registro
|
120 |
-
|
121 |
|
122 |
-
|
123 |
-
diferencia = fecha_actual - fecha_registro
|
124 |
-
|
125 |
-
if resultado == True:
|
126 |
-
print("El resultado es True, aquí checaríamos la hora.")
|
127 |
if diferencia.days > 1:
|
128 |
-
print("Renovación directa por distancia superior a 1 día...")
|
129 |
print("Renovando segundos.")
|
130 |
renuevaSegundosDisponibles()
|
131 |
renuevaTimestampActual()
|
132 |
else: #Si la diferencia es de un solo día entonces si debe checar si ya rebaso la hora de renovación del servidor.
|
133 |
hora_actual = datetime_obj_2.time()
|
134 |
print("Hora Segunda extracción: ", hora_actual)
|
135 |
-
print("La hora exacta es: ", hora_actual.hour)
|
136 |
print("La hora renovación es: ", globales.hora_renovacion)
|
137 |
-
|
|
|
|
|
|
|
|
|
138 |
print("Renovando segundos.")
|
139 |
renuevaSegundosDisponibles()
|
140 |
renuevaTimestampActual()
|
|
|
111 |
|
112 |
# Extraer solo la fecha de los objetos datetime
|
113 |
fecha_registro = datetime_obj_1.date()
|
|
|
114 |
fecha_actual = datetime_obj_2.date()
|
|
|
115 |
|
116 |
# Verificar si las fechas son diferentes
|
117 |
+
resultado = fecha_actual > fecha_registro
|
118 |
+
diferencia = fecha_actual - fecha_registro
|
119 |
|
120 |
+
if resultado == True:
|
|
|
|
|
|
|
|
|
121 |
if diferencia.days > 1:
|
|
|
122 |
print("Renovando segundos.")
|
123 |
renuevaSegundosDisponibles()
|
124 |
renuevaTimestampActual()
|
125 |
else: #Si la diferencia es de un solo día entonces si debe checar si ya rebaso la hora de renovación del servidor.
|
126 |
hora_actual = datetime_obj_2.time()
|
127 |
print("Hora Segunda extracción: ", hora_actual)
|
|
|
128 |
print("La hora renovación es: ", globales.hora_renovacion)
|
129 |
+
print("Tipo hora_actual: ", type(hora_actual.hour))
|
130 |
+
print("Tipo global hora renovación: ", type(globales.hora_renovacion))
|
131 |
+
|
132 |
+
if int(hora_actual.hour) > int(globales.hora_renovacion):
|
133 |
+
|
134 |
print("Renovando segundos.")
|
135 |
renuevaSegundosDisponibles()
|
136 |
renuevaTimestampActual()
|