Commit 8443652b by Juan Pablo dure

Tiempo dinamico en la espera descarga

1 parent 37b8eee2
...@@ -55,15 +55,27 @@ class FosaDiaria(): ...@@ -55,15 +55,27 @@ class FosaDiaria():
def BuscarExcelDescargado(self,tmp="/dev/shm/tmpscdecas.txt"): def BuscarExcelDescargado(self,tmp="/dev/shm/tmpscdecas.txt"):
rta = "" test = True
sleep(2) n = 0
os.system(f"""ls {self.CarpetaDescarga} -ls | grep xls 2> {tmp}""") while test:
arc = self._BuscarExcelDescargado(tmp)
n = n + 1
if not arc == False:
test = False
if n > 20:
return " "
return(arc)
def _BuscarExcelDescargado(self,tmp="/dev/shm/tmpscdecas.txt"):
rta = False
sleep(0.5)
os.system(f"""ls {self.CarpetaDescarga} -ls | grep xls | grep {self.cabezaera}2> {tmp}""")
file1 = open(tmp, 'r') file1 = open(tmp, 'r')
Lines = file1.readlines() Lines = file1.readlines()
for line in Lines: for line in Lines:
print(line) print(line)
der = line.split(" ")[-1] der = line.split(" ")[-1]
archivo = f"""{der}""" archivo = f"""{self.CarpetaDescarga}{der}"""
print(archivo) print(archivo)
rta = archivo rta = archivo
file1.close() file1.close()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!