-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·42 lines (33 loc) · 1.59 KB
/
main.py
File metadata and controls
executable file
·42 lines (33 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# ==============================================================================
# main.py - Punto de entrada principal del Moderador Semántico
# ==============================================================================
import argparse
from pathlib import Path
from moderador_semantico import ModeradorSemantico
from config import config
def main():
parser = argparse.ArgumentParser(description='Moderador Semántico de Twitch')
parser.add_argument('--file', '-f', help='Archivo de logs a procesar')
parser.add_argument('--message', '-m', help='Mensaje individual a analizar')
parser.add_argument('--user', '-u', default='test_user', help='Usuario para mensaje individual')
parser.add_argument('--batch', '-b', action='store_true', help='Procesar todos los logs en el directorio')
args = parser.parse_args()
moderador = ModeradorSemantico(file_path=args.file)
if args.message:
moderador.analyze_single_message(args.message, args.user)
elif args.file:
moderador.process_log_file(args.file)
elif args.batch:
logs_dir = Path(config.LOGS_PATH)
if logs_dir.exists():
log_files = list(logs_dir.glob("*.log"))
print(f"📁 Encontrados {len(log_files)} archivos de logs")
for log_file in log_files:
moderador.process_log_file(str(log_file))
else:
print(f"❌ Directorio de logs no encontrado: {logs_dir}")
else:
print("❌ Especifica --file, --message o --batch")
parser.print_help()
if __name__ == "__main__":
main()