Пример #1
0
    def dynamic_load_library(self, a_plugin_info):
        """Dynamically load the plugin info if not loaded


        Parameters
        --------------

        a_plugin_info:
            a instance of plugin info
        """
        if a_plugin_info.cls is None:
            self._logger.debug("import " + a_plugin_info.absolute_import_path)
            cls = do_import_class(a_plugin_info.absolute_import_path)
            a_plugin_info.cls = cls
        return a_plugin_info.cls
Пример #2
0
    def dynamic_load_library(self, a_plugin_info):
        """Dynamically load the plugin info if not loaded


        Parameters
        --------------

        a_plugin_info:
            a instance of plugin info
        """
        if a_plugin_info.cls is None:
            self._logger.debug("import " + a_plugin_info.absolute_import_path)
            cls = do_import_class(a_plugin_info.absolute_import_path)
            a_plugin_info.cls = cls
        return a_plugin_info.cls
Пример #3
0
def test_do_import_cls():
    from lml.utils import do_import_class

    manager = do_import_class("lml.plugin.PluginManager")
    eq_(manager, PluginManager)
Пример #4
0
def test_do_import_cls():
    from lml.utils import do_import_class

    manager = do_import_class("lml.plugin.PluginManager")
    assert manager == PluginManager