Return metadata whose path/raw_path/source_path equals ``path``. ``path`` is a registry path string (posix, relative to the KB dir when inside it) as produced by ``converter._registry_path``. Entries written before the path index existed carry none of these fields and
(self, path: str)
| 36 | return dict(self._data) |
| 37 | |
| 38 | def get_by_path(self, path: str) -> dict | None: |
| 39 | """Return metadata whose path/raw_path/source_path equals ``path``. |
| 40 | |
| 41 | ``path`` is a registry path string (posix, relative to the KB dir |
| 42 | when inside it) as produced by ``converter._registry_path``. Entries |
| 43 | written before the path index existed carry none of these fields and |
| 44 | never match. |
| 45 | """ |
| 46 | for metadata in self._data.values(): |
| 47 | if path in ( |
| 48 | metadata.get("path"), |
| 49 | metadata.get("raw_path"), |
| 50 | metadata.get("source_path"), |
| 51 | ): |
| 52 | return metadata |
| 53 | return None |
| 54 | |
| 55 | def find_legacy_by_stem(self, stem: str) -> tuple[str, dict] | None: |
| 56 | """Find a pre-path-index entry matching ``stem``. |