def activate(self, plugins=[]):
        """
        Activates given plugins.

        This calls mainly plugin.activate() and plugins register needed resources like commands, signals or
        documents.

        If given plugins have not been initialised, this is also done via :func:`_load`.

        :param plugins: List of plugin names
        :type plugins: list of strings
        """
        self._log.debug("Plugins Activation started")

        if not isinstance(plugins, list):
            raise AttributeError("plugins must be a list, not %s" % type(plugins))

        self._log.debug("Plugins to activate: %s" % ", ".join(plugins))

        plugins_activated = []
        for plugin_name in plugins:
            if not isinstance(plugin_name, str):
                raise AttributeError("plugin name must be a str, not %s" % type(plugin_name))

            if plugin_name not in self._plugins.keys() and plugin_name in self.classes._classes.keys():
                self._log.debug("Initialisation needed before activation.")
                try:
                    self.initialise_by_names([plugin_name])
                except Exception as e:
                    self._log.error("Couldn't initialise plugin %s. Reason %s" % (plugin_name, e))
                    if self._app.strict:
                        error = "Couldn't initialise plugin %s" % plugin_name
                        if sys.version_info[0] < 3:
                            error += "Reason: %s" % e
                        raise_from(Exception(error), e)
                    else:
                        continue
            if plugin_name in self._plugins.keys():
                self._log.debug("Activating plugin %s" % plugin_name)
                if not self._plugins[plugin_name].active:
                    try:
                        self._plugins[plugin_name].activate()
                    except Exception as e:
                        raise_from(
                            PluginNotActivatableException("Plugin %s could not be activated: %s" % (plugin_name,
                                                                                                    e)), e)
                    else:
                        self._log.debug("Plugin %s activated" % plugin_name)
                        plugins_activated.append(plugin_name)
                else:
                    self._log.warning("Plugin %s got already activated." % plugin_name)
                    if self._app.strict:
                        raise PluginNotInitialisableException()

        self._log.info("Plugins activated: %s" % ", ".join(plugins_activated))
def activate ( self , plugins = [ ] ) : self . _log . debug ( "Plugins Activation started" ) if not isinstance ( plugins , list ) : raise AttributeError ( "plugins must be a list, not %s" % type ( plugins ) ) self . _log . debug ( "Plugins to activate: %s" % ", " . join ( plugins ) ) plugins_activated = [ ] for plugin_name in plugins : if not isinstance ( plugin_name , str ) : raise AttributeError ( "plugin name must be a str, not %s" % type ( plugin_name ) ) if plugin_name not in self . _plugins . keys ( ) and plugin_name in self . classes . _classes . keys ( ) : self . _log . debug ( "Initialisation needed before activation." ) try : self . initialise_by_names ( [ plugin_name ] ) except Exception as e : self . _log . error ( "Couldn't initialise plugin %s. Reason %s" % ( plugin_name , e ) ) if self . _app . strict : error = "Couldn't initialise plugin %s" % plugin_name if sys . version_info [ 0 ] < 3 : error += "Reason: %s" % e raise_from ( Exception ( error ) , e ) else : continue if plugin_name in self . _plugins . keys ( ) : self . _log . debug ( "Activating plugin %s" % plugin_name ) if not self . _plugins [ plugin_name ] . active : try : self . _plugins [ plugin_name ] . activate ( ) except Exception as e : raise_from ( PluginNotActivatableException ( "Plugin %s could not be activated: %s" % ( plugin_name , e ) ) , e ) else : self . _log . debug ( "Plugin %s activated" % plugin_name ) plugins_activated . append ( plugin_name ) else : self . _log . warning ( "Plugin %s got already activated." % plugin_name ) if self . _app . strict : raise PluginNotInitialisableException ( ) self . _log . info ( "Plugins activated: %s" % ", " . join ( plugins_activated ) )
Activates given plugins.

        This calls mainly plugin.activate() and plugins register needed resources like commands, signals or
        documents.

        If given plugins have not been initialised, this is also done via :func:`_load`.

        :param plugins: List of plugin names
        :type plugins: list of strings