How to use the configparser.ConfigParser.set function in configparser

To help you get started, we’ve selected a few configparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nthmost / python-secureconfig / secureconfig / secureconfigparser.py View on Github external
def raw_set(self, sec, key, val):
        """Set the value without encrypting it."""
        return ConfigParser.set(self, sec, key, val)
github captin411 / ofxclient / ofxclient / config.py View on Github external
def set(self, section, option, value):
        """Set an option value. Knows how to set options properly marked
        as secure."""
        if value is False:
            value = '!!False!!'
        if self.is_secure_option(section, option):
            self.set_secure(section, option, value)
        else:
            ConfigParser.set(self, section, option, value)
github edyoung / gnofract4d / fract4d / fractconfig.py View on Github external
def set_size(self, width, height):
        if self.getint("display", "height") == height and \
           self.getint("display", "width") == width:
            return

        configparser.ConfigParser.set(self, "display", "height", str(height))
        configparser.ConfigParser.set(self, "display", "width", str(width))
        self.changed("display")
github edyoung / gnofract4d / fract4d / fractconfig.py View on Github external
def set_list(self, name, list):
        self.remove_all_in_list_section(name)

        i = 0
        for item in list:
            configparser.ConfigParser.set(self, name, "%d" % i, item)
            i += 1

        self.changed(name)
github edyoung / gnofract4d / fract4d / fractconfig.py View on Github external
def set_main_window_size(self, width, height):
        if self.getint("main_window", "height") == height and \
           self.getint("main_window", "width") == width:
            return

        configparser.ConfigParser.set(
            self, "main_window", "height", str(height))
        configparser.ConfigParser.set(self, "main_window", "width", str(width))
        self.changed("main_window")
github SamSchott / maestral-dropbox / maestral / config / user.py View on Github external
def _set(self, section, option, value, verbose):
        """
        Private set method
        """
        if not self.has_section(section):
            self.add_section(section)
        if not isinstance(value, str):
            value = repr(value)
        if verbose:
            print('%s[ %s ] = %s' % (section, option, value))
        cp.ConfigParser.set(self, section, option, value)
github v3aqb / fwlite / fgfw-lite / util.py View on Github external
def set(self, section, option, value):
        if not self.has_section(section):
            self.add_section(section)
        configparser.ConfigParser.set(self, section, option, value)