Recursively parse the nested data in config source, add every item as `ConfigItem` to the resolver. Args: config: config source to parse. id: id of the ``ConfigItem``, ``"::"`` (or ``"#"``) in id are interpreted as special characters to go on
(self, config: Any, id: str = "")
| 566 | self.set(self._do_resolve(config=self.get())) |
| 567 | |
| 568 | def _do_parse(self, config: Any, id: str = "") -> None: |
| 569 | """ |
| 570 | Recursively parse the nested data in config source, add every item as `ConfigItem` to the resolver. |
| 571 | |
| 572 | Args: |
| 573 | config: config source to parse. |
| 574 | id: id of the ``ConfigItem``, ``"::"`` (or ``"#"``) in id are interpreted as special characters to |
| 575 | go one level further into the nested structures. |
| 576 | Use digits indexing from "0" for list or other strings for dict. |
| 577 | For example: ``"xform::5"``, ``"net::channels"``. ``""`` indicates the entire ``self.config``. |
| 578 | |
| 579 | """ |
| 580 | if isinstance(config, (dict, list)): |
| 581 | for _, sub_id, v in self.ref_resolver.iter_subconfigs(id=id, config=config): |
| 582 | self._do_parse(config=v, id=sub_id) |
| 583 | |
| 584 | if ConfigComponent.is_instantiable(config): |
| 585 | self.ref_resolver.add_item(ConfigComponent(config=config, id=id, locator=self.locator)) |
| 586 | elif ConfigExpression.is_expression(config): |
| 587 | self.ref_resolver.add_item(ConfigExpression(config=config, id=id, globals=self.globals)) |
| 588 | else: |
| 589 | self.ref_resolver.add_item(ConfigItem(config=config, id=id)) |
| 590 | |
| 591 | @classmethod |
| 592 | def load_config_file(cls, filepath: PathLike, **kwargs: Any) -> dict: |
no test coverage detected