How to use the configparser.RawConfigParser.get 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 number5 / cloud-init / cloudinit / helpers.py View on Github external
def get(self, section, option):
        value = self.DEF_BASE
        try:
            value = RawConfigParser.get(self, section, option)
        except NoSectionError:
            pass
        except NoOptionError:
            pass
        return value
github xificurk / pyggs / Configurator.py View on Github external
def get(self, section, option):
        """Get section->option, from config, or self.defaults"""
        try:
            value = configparser.RawConfigParser.get(self, section, option)
        except (configparser.NoSectionError, configparser.NoOptionError):
            try:
                value = self.defaults[section][option]
            except KeyError:
                value = ""
        return value
github TailorDev / Watson / watson / config.py View on Github external
def get(self, section, option, default=None, **kwargs):
        """
        Return value of option in given configuration section as a string.

        If option is not set, return default instead (defaults to None).

        """
        return (RawConfigParser.get(self, section, option, **kwargs)
                if self.has_option(section, option) else default)
github modm-io / modm / scons / site_tools / configfile.py View on Github external
def get(self, section, option, default=None, **kwargs):
		try:
			return configparser.RawConfigParser.get(self, section, option, **kwargs)
		except (configparser.NoOptionError,
				configparser.NoSectionError) as e:
			if default != None:
				return default
			else:
				raise ParserException(e)
github xificurk / pyggs / libs / configuration.py View on Github external
def get(self, section, option):
        """ Get section->option from config, or self.defaults.
        """
        try:
            value = configparser.RawConfigParser.get(self, section, option)
        except (configparser.NoSectionError, configparser.NoOptionError):
            try:
                value = self.defaults[section][option]
            except KeyError:
                value = ""
        return value
github rootzoll / raspiblitz / home.admin / BlitzPy / blitzpy / config.py View on Github external
def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
        val = RawConfigParser.get(self, section, option)
        return val.strip('"').strip("'")