Limpieza de codigo
This commit is contained in:
parent
c9c8ac54a4
commit
863f3bedec
16
main.py
16
main.py
|
|
@ -48,8 +48,6 @@ def seleccionar_archivo_curses(stdscr):
|
||||||
def seleccionar_archivo():
|
def seleccionar_archivo():
|
||||||
return curses.wrapper(seleccionar_archivo_curses)
|
return curses.wrapper(seleccionar_archivo_curses)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
memoria_combinaciones = {}
|
memoria_combinaciones = {}
|
||||||
def elegir_combinacion(strtemp):
|
def elegir_combinacion(strtemp):
|
||||||
combinaciones = []
|
combinaciones = []
|
||||||
|
|
@ -66,7 +64,7 @@ def elegir_combinacion(strtemp):
|
||||||
(' '.join(strtemp[:3]), strtemp[3])
|
(' '.join(strtemp[:3]), strtemp[3])
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
return strtemp # No intervenimos en otros casos
|
return strtemp
|
||||||
|
|
||||||
claves_posibles = [parte1 for parte1, parte2 in combinaciones]
|
claves_posibles = [parte1 for parte1, parte2 in combinaciones]
|
||||||
|
|
||||||
|
|
@ -129,9 +127,6 @@ def parsear_documento(archivo):
|
||||||
for i, campo in enumerate(cabecera.campos):
|
for i, campo in enumerate(cabecera.campos):
|
||||||
valor = strtemp[i] if i < len(strtemp) else ""
|
valor = strtemp[i] if i < len(strtemp) else ""
|
||||||
df_parseado.at[fila_index, campo] = valor
|
df_parseado.at[fila_index, campo] = valor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
df_parseado.at[fila_index,cabecera.campos[0]] = str(row[cabecera.indice]).replace('\n',' ')
|
df_parseado.at[fila_index,cabecera.campos[0]] = str(row[cabecera.indice]).replace('\n',' ')
|
||||||
else:
|
else:
|
||||||
|
|
@ -163,8 +158,6 @@ def mostrar_menu(archivo, documento_parseado):
|
||||||
else:
|
else:
|
||||||
print(Fore.LIGHTBLACK_EX + "3) Exportar a Excel [desactivado]")
|
print(Fore.LIGHTBLACK_EX + "3) Exportar a Excel [desactivado]")
|
||||||
|
|
||||||
print("4) Modificar archivo ya parseado")
|
|
||||||
|
|
||||||
print("0) Salir")
|
print("0) Salir")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
@ -198,13 +191,6 @@ def main():
|
||||||
else:
|
else:
|
||||||
exportar_a_excel(documento_parseado)
|
exportar_a_excel(documento_parseado)
|
||||||
|
|
||||||
elif opcion =="4":
|
|
||||||
archivoParser = seleccionar_archivo()
|
|
||||||
if archivo:
|
|
||||||
print(f"\nArchivo seleccionado: {archivo}")
|
|
||||||
else:
|
|
||||||
print("\nNo se seleccionó ningún archivo.")
|
|
||||||
|
|
||||||
elif opcion == "0":
|
elif opcion == "0":
|
||||||
print("\nSaliendo del programa...")
|
print("\nSaliendo del programa...")
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user