feat: Introduce build and installation scripts for IPSExtractor, including a batch file for PyInstaller and Inno Setup integration, and add application preferences management for document types and retry logic in the GUI.
This commit is contained in:
@@ -11,6 +11,12 @@ from typing import Dict, List, Callable, Optional
|
||||
import customtkinter as ctk
|
||||
import threading
|
||||
import tkinter.messagebox as mb
|
||||
from application.app_prefs import get_allowed_document_types
|
||||
|
||||
DOCUMENT_TYPE_HINT_ALIASES = {
|
||||
"CC", "TI", "CE", "RC", "PA", "PPT", "PEP", "EPT", "NUIP",
|
||||
"PT", "PAS", "PASS",
|
||||
}
|
||||
|
||||
|
||||
class FieldSelectorDialog(ctk.CTkToplevel):
|
||||
@@ -99,6 +105,7 @@ class FieldSelectorDialog(ctk.CTkToplevel):
|
||||
except Exception:
|
||||
pass
|
||||
alias_entry.grid(row=0, column=1, padx=(12, 0))
|
||||
self._add_document_type_hint(row, path)
|
||||
try:
|
||||
alias_entry.bind("<KeyRelease>", lambda _e: self._validate_aliases())
|
||||
except Exception:
|
||||
@@ -332,6 +339,7 @@ class FieldSelectorDialog(ctk.CTkToplevel):
|
||||
except Exception:
|
||||
pass
|
||||
alias_entry.grid(row=0, column=1, padx=(12, 0))
|
||||
self._add_document_type_hint(row, path)
|
||||
try:
|
||||
alias_entry.bind("<KeyRelease>", lambda _e: self._validate_aliases())
|
||||
except Exception:
|
||||
@@ -361,3 +369,18 @@ class FieldSelectorDialog(ctk.CTkToplevel):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def _add_document_type_hint(self, row: ctk.CTkFrame, path: str) -> None:
|
||||
"""Muestra una ayuda breve bajo claves tipo CC, TI, CE, PAS, etc."""
|
||||
key_tail = str(path or "").split("/")[-1].strip().upper()
|
||||
valid_hint_keys = set(get_allowed_document_types()) | DOCUMENT_TYPE_HINT_ALIASES
|
||||
if key_tail not in valid_hint_keys:
|
||||
return
|
||||
|
||||
hint = ctk.CTkLabel(
|
||||
row,
|
||||
text="Si a este campo le pones el alias 'documento_forzate', se guardará con la sigla exacta detectada, por ejemplo 'CC 123456789' o 'EPT 123456789'.",
|
||||
anchor="w",
|
||||
justify="left",
|
||||
)
|
||||
hint.grid(row=1, column=0, columnspan=2, sticky="w", padx=(28, 0), pady=(2, 0))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user