# config.py
import os
import psutil
import uuid # NUEVO: Para identificar cada instancia del chat

# --- Rutas y Archivos ---
SCRIPT_NAME = "backup_script.sh" 
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 
SCRIPT_PATH = os.path.join(BASE_DIR, SCRIPT_NAME) 
archivo_registro_csv = os.path.join(BASE_DIR, "data", "registro_recursos.csv") 
PROGRESS_FILE = 'progress.tmp'

ALARM_SAVE_FILE = os.path.join(BASE_DIR, "data", "alarmas.json")
ALARM_FOLDER = os.path.join(BASE_DIR, "data", "alarmas")
ALERTA_SOUND_FILE = None 
SCRAPING_FOLDER = os.path.join(BASE_DIR, "data", "scraping") 
SCRAPING_CONFIG_FOLDER = os.path.join(BASE_DIR, "data", "tipo_scraping") 
NOTES_FOLDER = os.path.join(BASE_DIR, "data", "notas")

# --- NUEVO: Configuración de Chat Local (IPC) ---
CHAT_FILE = os.path.join(BASE_DIR, "data", "local_chat.txt")
INSTANCE_ID = str(uuid.uuid4())[:5] # ID único corto para esta ventana/proceso

# --- NUEVO: Configuración de Servidor de Correo ---
EMAIL_SERVER_IP = "10.10.0.101"
EMAIL_SMTP_PORT = 25
EMAIL_IMAP_PORT = 143
EMAIL_POP_PORT = 110

# --- Variables de Monitoreo ---
MAX_PUNTOS = 30  
tiempos = list(range(-MAX_PUNTOS + 1, 1)) 
num_cores = psutil.cpu_count(logical=True)
datos_cores = [0] * num_cores

datos_cpu = [0] * MAX_PUNTOS
datos_mem = [0] * MAX_PUNTOS
datos_net_sent = [0] * MAX_PUNTOS 
datos_net_recv = [0] * MAX_PUNTOS 
datos_disk_read = [0] * MAX_PUNTOS
datos_disk_write = [0] * MAX_PUNTOS

# --- Variables de Estado y UI ---
monitor_running = True 
registro_csv_activo = False
system_log = None 
progress_bar = None
editor_texto = None 
scraping_progress_bar = None 
scraping_output_text = None 
scraping_url_input = None 
scraping_selector_input = None 
scraping_attr_input = None 
scraping_config_file_label = None 
scraping_config_data = {} 
scraping_running = False 

alarmas_programadas = {} 
alarma_counter = 0 
alarma_volumen = 0.5 
alarma_sonando = False

juego_window = None 
juego_running = False 

current_music_file = None 
music_sonando = False 

label_hostname = None
label_os_info = None
label_cpu_model = None
label_ram_total = None
label_disk_total = None
label_net_info = None
label_uptime = None

label_1 = None 
label_2 = None 
label_fecha_hora = None