""" Parse TestMKS.set to see the structure of working mappings """ import sys sys.path.append(r'C:\DEV\COPILOT_codex') from geviset_parser import load_set from pathlib import Path import json # Load the configuration set_file = Path(r"C:\DEV\COPILOT_codex\TestMKS.set") tree = load_set(set_file) # Find MappingRules mapping_rules = None for child in tree.get("children", []): if child.get("name") == "MappingRules" and child.get("type") == "folder": mapping_rules = child break if not mapping_rules: print("ERROR: MappingRules not found!") sys.exit(1) print(f"Total mappings: {len(mapping_rules.get('children', []))}") print() # Find mappings with GSC or G-Core actions for mapping in mapping_rules.get("children", [])[:10]: # Check first 10 if mapping.get("type") != "folder": continue # Get mapping name name = None rules_folder = None for child in mapping.get("children", []): if child.get("name") == "@": name = child.get("value") if child.get("name") == "Rules" and child.get("type") == "folder": rules_folder = child if not rules_folder: continue # Check output actions has_gsc_or_gcore = False for output in rules_folder.get("children", []): if output.get("type") != "folder": continue for field in output.get("children", []): if field.get("name") in ["GscAction", "GCoreAction", "GngAction"]: has_gsc_or_gcore = True break if has_gsc_or_gcore: break if has_gsc_or_gcore: print("=" * 80) print(f"MAPPING: {name} (ID: {mapping.get('name')})") print("=" * 80) print() # Show output actions for i, output in enumerate(rules_folder.get("children", []), 1): if output.get("type") != "folder": continue print(f"Output Action {i}:") for field in output.get("children", []): field_name = field.get("name") field_type = field.get("type") field_value = field.get("value") if field_name in ["@", "GscAction", "GCoreAction", "GngAction", "GscServer", "GCoreServer"]: print(f" {field_name} ({field_type}): {field_value}") print() break # Just show the first one