Пример #1
0
    def init_from_config(self, config_module_path=""):
        """
        Initializes the labeltool from the given configuration
        at ``config_module_path``.  If empty, the default configuration
        is used.
        """
        # Load config
        if config_module_path:
            config.update(config_module_path)

        # Instatiate container factory
        self._container_factory = AnnotationContainerFactory(config.CONTAINERS)
Пример #2
0
def test_import_callable():
    containers = (('*', 'container_test.MockupContainer'), )
    factory = AnnotationContainerFactory(containers)
    item = factory.create('test')
    assert isinstance(item, MockupContainer)