Commit 6147553f by Juan Pablo dure

limpieza de codigo

1 parent e096a926
...@@ -59,9 +59,9 @@ class FosaDiaria(): ...@@ -59,9 +59,9 @@ class FosaDiaria():
n = 0 n = 0
while test: while test:
arc = self._BuscarExcelDescargado(tmp) arc = self._BuscarExcelDescargado(tmp)
print(arc, n)
n = n + 1 n = n + 1
if not arc == False: if not arc == False:
print(arc, n)
test = False test = False
if n > 70: if n > 70:
return " " return " "
...@@ -69,22 +69,13 @@ class FosaDiaria(): ...@@ -69,22 +69,13 @@ class FosaDiaria():
def _BuscarExcelDescargado(self,tmp): def _BuscarExcelDescargado(self,tmp):
rta = False rta = False
#cmd = f"""ls {self.CarpetaDescarga} -ls |grep {self.cabezaera}| grep xls | grep -v crdownload""".split(" ")
#rte = subprocess.check_output([grepfile])
os.system(grepfile) os.system(grepfile)
#print(cmd)
#print(rte)
#Lines = str(rte).split("\n")
sleep(0.1) sleep(0.1)
file1 = open(tmp, 'r') file1 = open(tmp, 'r')
Lines = file1.readlines() Lines = file1.readlines()
for line in Lines: for line in Lines:
der = str(line).split(" ") der = str(line).split(" ")
#print(1,type(line),type(der))
#print(2,der)
archivo = f"""{self.CarpetaDescarga}{der[-1]}""" archivo = f"""{self.CarpetaDescarga}{der[-1]}"""
#print(3,line,der,der[-1],archivo)
print(archivo)
rta = archivo.replace("\n","") rta = archivo.replace("\n","")
file1.close() file1.close()
os.system(f"""rm {tmp}""") os.system(f"""rm {tmp}""")
...@@ -93,6 +84,6 @@ class FosaDiaria(): ...@@ -93,6 +84,6 @@ class FosaDiaria():
def LimpiarCarpertaDescarga(self): def LimpiarCarpertaDescarga(self):
try: try:
os.system(f"""rm {self.CarpetaDescarga}{self.cabezaera}*""") os.system(f"""rm {self.CarpetaDescarga}{self.cabezaera}*""")
sleep(0.5) sleep(0.1)
except Exception as E: except Exception as E:
print(f"Error al intentar borrar planillas diarias anteriores: {str(E)}") print(f"Error al intentar borrar planillas diarias anteriores: {str(E)}")
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!