#!/usr/bin/env python3 import re from pathlib import Path PROJECT_ROOT = Path(__file__).parent.parent SOH_DIR = PROJECT_ROOT / "soh" / "soh" def fix_file(filepath): with open(filepath, 'r', encoding='utf-8') as f: content = f.read() original = content # Corregir: LUS_LOC(""CLAVE"") -> LUS_LOC("CLAVE") content = re.sub( r'LUS_LOC\(""([^"]+)""\)', r'LUS_LOC("\1")', content ) if content != original: with open(filepath, 'w', encoding='utf-8') as f: f.write(content) return True return False def main(): fixed = 0 for cpp_file in SOH_DIR.rglob("*.cpp"): if fix_file(cpp_file): fixed += 1 print(f" Corregido: {cpp_file.name}") print(f"\nArchivos corregidos: {fixed}") if __name__ == "__main__": main()