(
self,
config: Any = None,
excludes: Sequence[str] | str | None = None,
globals: dict[str, Any] | None | bool = None,
)
| 299 | meta_key = "_meta_" # field key to save metadata |
| 300 | |
| 301 | def __init__( |
| 302 | self, |
| 303 | config: Any = None, |
| 304 | excludes: Sequence[str] | str | None = None, |
| 305 | globals: dict[str, Any] | None | bool = None, |
| 306 | ): |
| 307 | self.config: ConfigItem | None = None |
| 308 | self.globals: dict[str, Any] = {} |
| 309 | _globals = _default_globals.copy() |
| 310 | if isinstance(_globals, dict) and globals not in (None, False): |
| 311 | _globals.update(globals) # type: ignore |
| 312 | if _globals is not None and globals is not False: |
| 313 | for k, v in _globals.items(): |
| 314 | self.globals[k] = optional_import(v)[0] if isinstance(v, str) else v |
| 315 | |
| 316 | self.locator = ComponentLocator(excludes=excludes) |
| 317 | self.ref_resolver = ReferenceResolver() |
| 318 | if config is None: |
| 319 | config = {self.meta_key: {}} |
| 320 | self.set(config=self.ref_resolver.normalize_meta_id(config)) |
| 321 | |
| 322 | def __repr__(self): |
| 323 | return f"{self.config}" |
nothing calls this directly
no test coverage detected