def _load_needed_plugins(self):
        """
        Checks if this plugins needs other plugins to work and tries to activate them
        :return: True, if all needed plugins are or got activated. Otherwise False
        """
        global plugin_recursive_store
        if "plugin_recursive_store" not in globals():
            plugin_recursive_store = []

        if self.name in plugin_recursive_store:
            self.log.warning("Plugin dependency loop detected: %s already checked and dependencies got activated" %
                             self.name)
            if self.app.strict:
                raise PluginDependencyLoop("Plugin dependency loop detected: %s already checked and dependencies "
                                           "got activated" % self.name)
            return False
        else:
            plugin_recursive_store.append(self.name)

        if not hasattr(self, "needed_plugins"):
            pass
        elif not isinstance(self.needed_plugins, tuple) and not isinstance(self.needed_plugins, list):
            raise TypeError("needed_plugins must be a tuple or a list")
        elif len(self.needed_plugins) > 0:
            try:
                for needed_plugin in self.needed_plugins:
                    if not isinstance(needed_plugin, str):
                        raise TypeError("Plugin name must be a string, got %s" % type(needed_plugin).__name__)
                    # Check, if a plugin with this name got already activated
                    plugin = self.app.plugins.get(needed_plugin)
                    if plugin is not None and not plugin.active:
                        plugin.activate()
                    # If not, check if a plugin_class with this name is available and activate it
                    plugin_class = self.app.plugins.classes.get(needed_plugin)
                    if plugin_class is not None:
                        plugin_class(self.app, needed_plugin)
            except Exception:
                plugin_recursive_store.remove(self.name)
                return False

        plugin_recursive_store.remove(self.name)
        return True
def _load_needed_plugins ( self ) : global plugin_recursive_store if "plugin_recursive_store" not in globals ( ) : plugin_recursive_store = [ ] if self . name in plugin_recursive_store : self . log . warning ( "Plugin dependency loop detected: %s already checked and dependencies got activated" % self . name ) if self . app . strict : raise PluginDependencyLoop ( "Plugin dependency loop detected: %s already checked and dependencies " "got activated" % self . name ) return False else : plugin_recursive_store . append ( self . name ) if not hasattr ( self , "needed_plugins" ) : pass elif not isinstance ( self . needed_plugins , tuple ) and not isinstance ( self . needed_plugins , list ) : raise TypeError ( "needed_plugins must be a tuple or a list" ) elif len ( self . needed_plugins ) > 0 : try : for needed_plugin in self . needed_plugins : if not isinstance ( needed_plugin , str ) : raise TypeError ( "Plugin name must be a string, got %s" % type ( needed_plugin ) . __name__ ) plugin = self . app . plugins . get ( needed_plugin ) if plugin is not None and not plugin . active : plugin . activate ( ) plugin_class = self . app . plugins . classes . get ( needed_plugin ) if plugin_class is not None : plugin_class ( self . app , needed_plugin ) except Exception : plugin_recursive_store . remove ( self . name ) return False plugin_recursive_store . remove ( self . name ) return True
Checks if this plugins needs other plugins to work and tries to activate them
        :return: True, if all needed plugins are or got activated. Otherwise False