コード例 #1
0
    def getPluginConfig(self):
        """All plugins and addons the current user has configured

        :rtype: list of PluginInfo
        """
        # TODO: include addons that are activated by default
        # TODO: multi user
        # TODO: better plugin / addon activated config
        data = []
        active = [x.getName() for x in self.core.addonManager.activePlugins()]
        for name, config, values in self.core.config.iterSections(
                self.primaryUID):
            # skip unmodified and inactive addons
            if not values and name not in active: continue

            item = ConfigInfo(
                name,
                config.label,
                config.description,
                self.core.pluginManager.getCategory(name),
                self.core.pluginManager.isUserPlugin(name),
                # TODO: won't work probably
                values.get(
                    "activated", None if "activated" not in config.config else
                    config.config["activated"].input.default_value))
            data.append(item)

        return data
コード例 #2
0
    def getCoreConfig(self):
        """ Retrieves core config sections

        :rtype: list of PluginInfo
        """
        return [ConfigInfo(section, config.label, config.description, False, False)
                for section, config, values in self.core.config.iterCoreSections()]
コード例 #3
0
    def getAvailablePlugins(self):
        """List of all available plugins, that are configurable

        :rtype: list of PluginInfo
        """
        # TODO: filter user_context / addons when not allowed
        plugins = [ConfigInfo(name, config.label, config.description,
                              self.core.pluginManager.getCategory(name),
                              self.core.pluginManager.isUserPlugin(name))
                   for name, config, values in self.core.config.iterSections(self.primaryUID)]

        return plugins