Skip to content

component_locator.py

ofrak.service.component_locator

ComponentLocator (ComponentLocatorInterface)

Locates component singletons from their types or id.

get_components_matching_filter(self, component_filter)

Get all components matching the given filter.

Source code in ofrak/service/component_locator.py
def get_components_matching_filter(
    self, component_filter: ComponentFilter
) -> Set[ComponentInterface]:
    # naive implementation to start
    # will be improved by caching
    components = set(self._components_by_id.values())

    return component_filter.filter(components)