Get preset metadata from registry. Returns a deep copy to prevent callers from accidentally mutating nested internal registry state without going through the write path. Args: pack_id: Preset ID Returns: Deep copy of preset metadata, or None
(self, pack_id: str)
| 441 | self._save() |
| 442 | |
| 443 | def get(self, pack_id: str) -> Optional[dict]: |
| 444 | """Get preset metadata from registry. |
| 445 | |
| 446 | Returns a deep copy to prevent callers from accidentally mutating |
| 447 | nested internal registry state without going through the write path. |
| 448 | |
| 449 | Args: |
| 450 | pack_id: Preset ID |
| 451 | |
| 452 | Returns: |
| 453 | Deep copy of preset metadata, or None if not found or corrupted |
| 454 | """ |
| 455 | packs = self.data.get("presets") |
| 456 | if not isinstance(packs, dict): |
| 457 | return None |
| 458 | entry = packs.get(pack_id) |
| 459 | # Return None for missing or corrupted (non-dict) entries |
| 460 | if entry is None or not isinstance(entry, dict): |
| 461 | return None |
| 462 | return copy.deepcopy(entry) |
| 463 | |
| 464 | def list(self) -> Dict[str, dict]: |
| 465 | """Get all installed presets with valid metadata. |
no outgoing calls