How to use the configparser.RawConfigParser.__init__ 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 xsystemgr / dmrlib / site_wright / wright / config.py View on Github external
def __init__(self, env, platform):
        RawConfigParser.__init__(self)
        self.env = env
        self.platform = platform
github Netflix / bless / bless / config / bless_config.py View on Github external
RANDOM_SEED_BYTES_OPTION: RANDOM_SEED_BYTES_DEFAULT,
                    LOGGING_LEVEL_OPTION: LOGGING_LEVEL_DEFAULT,
                    TEST_USER_OPTION: TEST_USER_DEFAULT,
                    KMSAUTH_SERVICE_ID_OPTION: KMSAUTH_SERVICE_ID_DEFAULT,
                    KMSAUTH_KEY_ID_OPTION: KMSAUTH_KEY_ID_DEFAULT,
                    KMSAUTH_REMOTE_USERNAMES_ALLOWED_OPTION: KMSAUTH_REMOTE_USERNAMES_ALLOWED_OPTION_DEFAULT,
                    KMSAUTH_USEKMSAUTH_OPTION: KMSAUTH_USEKMSAUTH_DEFAULT,
                    CERTIFICATE_EXTENSIONS_OPTION: CERTIFICATE_EXTENSIONS_DEFAULT,
                    USERNAME_VALIDATION_OPTION: USERNAME_VALIDATION_DEFAULT,
                    REMOTE_USERNAMES_VALIDATION_OPTION: REMOTE_USERNAMES_VALIDATION_DEFAULT,
                    VALIDATE_REMOTE_USERNAMES_AGAINST_IAM_GROUPS_OPTION: VALIDATE_REMOTE_USERNAMES_AGAINST_IAM_GROUPS_DEFAULT,
                    IAM_GROUP_NAME_VALIDATION_FORMAT_OPTION: IAM_GROUP_NAME_VALIDATION_FORMAT_DEFAULT,
                    REMOTE_USERNAMES_BLACKLIST_OPTION: REMOTE_USERNAMES_BLACKLIST_DEFAULT,
                    CA_PRIVATE_KEY_COMPRESSION_OPTION: CA_PRIVATE_KEY_COMPRESSION_OPTION_DEFAULT
                    }
        configparser.RawConfigParser.__init__(self, defaults=defaults)
        self.read(config_file)

        if not self.has_section(BLESS_CA_SECTION):
            self.add_section(BLESS_CA_SECTION)

        if not self.has_section(BLESS_OPTIONS_SECTION):
            self.add_section(BLESS_OPTIONS_SECTION)

        if not self.has_section(KMSAUTH_SECTION):
            self.add_section(KMSAUTH_SECTION)

        if not self.has_option(BLESS_CA_SECTION, self.aws_region + REGION_PASSWORD_OPTION_SUFFIX):
            if not self.has_option(BLESS_CA_SECTION, 'default' + REGION_PASSWORD_OPTION_SUFFIX):
                raise ValueError("No Region Specific And No Default Password Provided.")
github CNES / swot-hydrology-toolbox / processing / src / cnes / common / serviceConfigFile.py View on Github external
def __init__(self, path_conf):
        """
            Init class ServiceConfigFile
            :param path_conf: string path of the config file
        """
        if THIS.path_conf is None:
            # first set of path_conf and cfg
            if path_conf is None:
                raise Exception("First call to ServiceConfigFile: path_conf_name is not define")
            THIS.path_conf = path_conf
            # we call the constructor of mother class
            RawConfigParser.__init__(self)
            # we load the configuration file
            self.read(path_conf)
            # we save instance of class
            THIS.cfg = self
        #initialize_config(self, path_conf)
        self.path_conf = THIS.path_conf
github opalmer / pywincffi / pywincffi / core / config.py View on Github external
def __init__(self):  # pylint: disable=super-on-old-class
        if PY3:
            super(Configuration, self).__init__()
        else:
            RawConfigParser.__init__(self)

        self.load()
github rnorris / gpsd / gpscap.py View on Github external
def __init__(self, *files):
        "Initialize the capability dictionary"
        configparser.RawConfigParser.__init__(self)
        if not files:
            files = ["gpscap.ini", "/usr/share/gpsd/gpscap.ini"]
        self.read(files)
        # Resolve uses= members
        while True:
            keepgoing = False
            for section in self.sections():
                if self.has_option(section, "uses"):
                    parent = self.get(section, "uses")
                    if self.has_option(parent, "uses"):
                        continue
                    # Found a parent section without a uses = part.
                    for heritable in self.options(parent):
                        if not self.has_option(section, heritable):
                            self.set(section,
                                     heritable,
github DarkDNA / Schongo / config.py View on Github external
def __init__(self, *a, **kw):
		RawConfigParser.__init__(self, *a, **kw);
github gkrizek / bash-lambda-layer / bin / docutils / frontend.py View on Github external
def __init__(self, *args, **kwargs):
        CP.RawConfigParser.__init__(self, *args, **kwargs)

        self._files = []
        """List of paths of configuration files read."""

        self._stderr = ErrorOutput()
        """Wrapper around sys.stderr catching en-/decoding errors"""
github jpmens / mqttwarn / mqttwarn / configuration.py View on Github external
def __init__(self, configuration_file, defaults=None):

        defaults = defaults or {}

        RawConfigParser.__init__(self)
        f = codecs.open(configuration_file, 'r', encoding='utf-8')
        self.read_file(f)
        f.close()

        ''' set defaults '''
        self.hostname     = 'localhost'
        self.port         = 1883
        self.username     = None
        self.password     = None
        self.clientid     = None
        self.lwt          = None
        self.skipretained = False
        self.cleansession = False
        self.protocol     = 3

        self.logformat    = '%(asctime)-15s %(levelname)-8s [%(name)-25s] %(message)s'
github GeoscienceAustralia / tcrm / Utilities / config.py View on Github external
def __init__(self, defaults=DEFAULTS):
        RawConfigParser.__init__(self)
        self.readfp(io.StringIO(defaults))
        self.readonce = False