mejora de estilos

This commit is contained in:
jp.av.dev 2022-05-20 20:34:11 -04:00
parent ebff4c2a74
commit 3b8c52a565
2 changed files with 5 additions and 5 deletions

View File

@ -168,7 +168,7 @@ def main():
muevelog+"%s" % "--start", muevelog+"%s" % "--start",
shell=True) shell=True)
case '-c': case '-c':
console.print('[bold yellow]Cargando logs en base de datos[/bold yellow]') console.print('[bold yellow]Cargando logs en base de datos[/bold yellow]\n')
sql_alch.carga_logs() sql_alch.carga_logs()
case '-g': case '-g':
console.print('[yellow]Registro de datos de ipinfo[/yellow]') console.print('[yellow]Registro de datos de ipinfo[/yellow]')

View File

@ -146,7 +146,7 @@ def ip_registrada(ip):
def carga_access_log(log): def carga_access_log(log):
if os.path.exists(log): if os.path.exists(log):
nombre_log = log.split('/')[-1] nombre_log = log.split('/')[-1]
console.print(f'[bold yellow]Registrando [[/bold yellow]{nombre_log}[bold yellow]][/bold yellow]') console.print(f'[yellow]Registrando [[/yellow]{nombre_log}[yellow]][/yellow]')
try: try:
with open(log, 'r') as lista: with open(log, 'r') as lista:
try: try:
@ -208,7 +208,7 @@ def carga_access_log(log):
time.sleep(0.05) time.sleep(0.05)
except Exception as ex: except Exception as ex:
print('Exception Progress: ', ex) print('Exception Progress: ', ex)
console.print('[bold green] - Carga completa.. borrando log[/bold green]\n') console.print('[magenta] - Carga completa.. borrando log[/magenta]\n')
os.remove(log) os.remove(log)
return True return True
except: except:
@ -222,7 +222,7 @@ def carga_access_log(log):
def carga_error_logs(log): def carga_error_logs(log):
if os.path.exists(log): if os.path.exists(log):
nombre_log = log.split('/')[-1] nombre_log = log.split('/')[-1]
console.print(f'[bold yellow]Registrando [[/bold yellow]{nombre_log}[bold yellow]][/bold yellow]') console.print(f'[yellow]Registrando [[/yellow]{nombre_log}[yellow]][/yellow]')
try: try:
#with Progress(), open(log, 'r') as lista: #with Progress(), open(log, 'r') as lista:
with open(log, 'r') as lista: with open(log, 'r') as lista:
@ -300,7 +300,7 @@ def carga_error_logs(log):
time.sleep(0.05) time.sleep(0.05)
except Exception as ex: except Exception as ex:
print('Exception Progress: ', ex) print('Exception Progress: ', ex)
console.print(f'[bold green] - Carga completa.. borrando log[/bold green]\n') console.print(f'[magenta] - Carga completa.. borrando log[/magenta]\n')
os.remove(log) os.remove(log)
return True return True
except: except: