def _class_for_type(self, component_type): if isinstance(component_type, str): component_type = self._types.get(component_type) if self._components.get(component_type) is None: raise errors.UnregisteredComponentError( "No component of type '%s' found!" % component_type) return component_type
def get_component(self, component_type, name): component = self._get_component(component_type).get(name) if component is None: raise errors.UnregisteredComponentError( "No component '%s' with name '%s' found!" % (component_type, name)) return component
def _get_component(self, item): component = self._components.get(item) if component is None: raise errors.UnregisteredComponentError("No component of type '%s' found!" % item) return component