Example #1
0
def toConfigHolder(section, config, values):
    holder = ConfigHolder(section, config.name, config.description,
                          config.long_desc)
    holder.items = [
        ConfigItem(option, x.name, x.description, x.type, to_string(x.default),
                   to_string(values.get(option, x.default)))
        for option, x in config.config.iteritems()
    ]
    return holder
Example #2
0
    def getConfig(self):
        """Retrieves complete config of core.

        :rtype: dict of section -> ConfigHolder
        """
        data = {}
        for section, config, values in self.core.config.iterCoreSections():
            holder = ConfigHolder(section, config.name, config.description, config.long_desc)
            holder.items = [ConfigItem(option, x.name, x.description, x.type, to_string(x.default),
                to_string(values.get(option, x.default))) for option, x in config.config.iteritems()]

            data[section] = holder
        return data
Example #3
0
    def getConfigValue(self, section, option):
        """Retrieve config value.

        :param section: name of category, or plugin
        :param option: config option
        :rtype: str
        :return: config value as string
        """
        value = self.core.config.get(section, option, self.primaryUID)
        return to_string(value)
Example #4
0
    def getConfigValue(self, section, option):
        """Retrieve config value.

        :param section: name of category, or plugin
        :param option: config option
        :rtype: str
        :return: config value as string
        """
        value = self.core.config.get(section, option, self.primaryUID)
        return to_string(value)
Example #5
0
def toConfigHolder(section, config, values):
    holder = ConfigHolder(section, config.name, config.description, config.long_desc)
    holder.items = [ConfigItem(option, x.name, x.description, x.type, to_string(x.default),
                               to_string(values.get(option, x.default))) for option, x in
                    config.config.iteritems()]
    return holder