Load the user defined settings, overriding the defaults
490594
def _load_custom(self, settings_name='localsettings.py'):
        '''
        

        '''
        if settings_name[-3:] == '.py':
            settings_name = settings_name[:-3]

        new_settings = {}
        try:
            settings = importlib.import_module(settings_name)
            new_settings = self._convert_to_dict(settings)
        except ImportError:
            log.info("No override settings found")

        for key in new_settings:
            if key in self.my_settings:
                item = new_settings[key]
                if isinstance(item, dict) and \
                        isinstance(self.my_settings[key], dict):
                    for key2 in item:
                        self.my_settings[key][key2] = item[key2]
                else:
                    self.my_settings[key] = item
            else:
                self.my_settings[key] = new_settings[key]
279719
def set(self, **kwargs):
        '''
        
        '''
        for lower_key, value in kwargs.items():
            if lower_key.lower() != lower_key:
                raise ValueError('Requires lowercase: %s' % lower_key)
            key = lower_key.upper()
            try:
                getattr(self, key)
            except (AttributeError, ConfigurationError):
                raise AttributeError('Cannot override %s' % key)
            self.overridden_settings[key] = value
96610
def _set_defaults(self, namespace, optional_cfg_files):
        
        # Add current configuration directory
        namespace["config_dir"] = self.config_dir

        # Load defaults
        for idx, cfg_file in enumerate([self.CONFIG_INI] + optional_cfg_files):
            if any(i in cfg_file for i in set('/' + os.sep)):
                continue # skip any non-plain filenames

            try:
                defaults = pymagic.resource_string("pyrocore", "data/config/" + cfg_file) #@UndefinedVariable
            except IOError as exc:
                if idx and exc.errno == errno.ENOENT:
                    continue
                raise

            ini_file = ConfigParser.SafeConfigParser()
            ini_file.optionxform = str # case-sensitive option names
            ini_file.readfp(StringIO.StringIO(defaults), "<defaults>")
            self._set_from_ini(namespace, ini_file)
150077
def load(self):
        """"""

        # Config files prior to 0.2.4 dor not have config version keys
        old_config = not self.cfg_file.Exists("config_version")

        # Reset data
        self.data.__dict__.update(self.defaults.__dict__)

        for key in self.defaults.__dict__:
            if self.cfg_file.Exists(key):
                setattr(self.data, key, self.cfg_file.Read(key))

        # Reset keys that should be reset on version upgrades
        if old_config or self.version != self.data.config_version:
            for key in self.reset_on_version_change:
                setattr(self.data, key, getattr(DefaultConfig(), key))
            self.data.config_version = self.version

        # Delete gpg_key_uid and insert fingerprint key

        if hasattr(self.data, "gpg_key_uid"):
            oldkey = "gpg_key_uid"
            delattr(self.data, oldkey)
            newkey = "gpg_key_fingerprint"
            setattr(self.data, newkey, getattr(DefaultConfig(), newkey))
765392
def update_defaults(self, ext_config):
        
        for setting in dir(ext_config):
            if setting.isupper() and not hasattr(self, setting):
                setattr(self, setting, getattr(ext_config, setting))
419983
def load_config(self):
        """"""
        expanded_state = self.get_option('expanded_state', None)
        # Sometimes the expanded state option may be truncated in .ini file
        # (for an unknown reason), in this case it would be converted to a
        # string by 'userconfig':
        if is_text_string(expanded_state):
            expanded_state = None
        if expanded_state is not None:
            self.explorer.treewidget.set_expanded_state(expanded_state)
124261
def load_all(self):
        '''
        
        '''
        # check for custom conf file before loading conf
        self._load_command_line(conf_only=True)
        self._load_config_file()
        self._load_env()
        self._load_command_line()
        self._imply_options()
        self._validate_options()
        return self
1150549
def load(cls, filename=None):
        """"""
        if filename is None:
            LOGGER.debug("Loading default configuration.")
            with open_text(templates, "test_config.yml",
                           encoding="utf-8") as file_handle:
                content = yaml.load(file_handle)
        else:
            LOGGER.debug("Loading custom configuration '%s'.", filename)
            try:
                with open(filename, encoding="utf-8") as file_handle:
                    content = yaml.load(file_handle)
            except IOError as err:
                LOGGER.error(
                    "Failed to load the custom configuration '%s'. Skipping.",
                    filename)
                LOGGER.debug(str(err))
                content = dict()
        return cls(content)
1021908
def load_config(self):
    """"""
    config = dict([(key, value) for key, value in iteritems(self.options)
                   if key in self.cfg.settings and value is not None])
    for key, value in iteritems(config):
      self.cfg.set(key.lower(), value)
1155317
def _load_config(self):
        ""
        
        config = SafeConfigParser()
        config_file = os.path.join(self.config_path, 'settings.ini')
        config.read(config_file)

        for option, type in list(AVAILABLE_OPTIONS.items()):
            if config.has_option('DEFAULT', option):
                if type == 'int':
                    value = config.getint('DEFAULT', option)
                if type == 'float':
                    value = config.getfloat('DEFAULT', option)
                if type == 'bool':
                    value = config.getboolean('DEFAULT', option)
                if type == 'str':
                    value = config.get('DEFAULT', option)

                self.livestreamer.set_option(option, value)
260463
def init_defaults(self):
        
        self.sql = ''
        self.tables = []
        self.joins = []
        self._where = Where()
        self.groups = []
        self.sorters = []
        self._limit = None
        self.table_prefix = ''
        self.is_inner = False
        self.with_tables = []
        self._distinct = False
        self.distinct_ons = []
        self.field_names = []
        self.field_names_pk = None
        self.values = []
800733
protected function loadConfigurationOptions()
    {
        if ( ! empty($this->options)) return;

        $this->mergeDefaultConfiguration();

        $this->options = $this->app->make('config')->get('html');

        $this->options['theme_values'] = Arr::get($this->options['themes'], $this->options['theme']);

        unset ($this->options['themes']);
    }
1006116
def loadSettings(self):
        """"""
        self.settings.beginGroup('mainwindow')
        geometry = self.settings.value('geometry').toByteArray()
        state = self.settings.value('windowstate').toByteArray()

        default_ramp_path = os.path.join(main_package_dir,
                                         'examples/test_scene.json')

        self.path_to_ramp_file = str(self.settings.value('path_to_ramp_file',
                                     default_ramp_path).toString())
        self.path_to_load_mot_file = str(self.settings.value('path_to_load_mot_file',
                                         default_ramp_path).toString())
        if not os.path.isfile(self.path_to_ramp_file):
            self.path_to_ramp_file = default_ramp_path
        self.settings.endGroup()

        self.restoreGeometry(geometry)
        self.restoreState(state)
571122
function loadFromOptions(opts) {
  var defCfg = loadDefault()
  var cfg = opts.config ? loadFromFile(opts.config) : loadDefault()

  // Command line config override file loaded config
  for (var k in opts) {
    defCfg.hasOwnProperty(k) && (defCfg[k] !== opts[k] && (cfg[k] = opts[k]))
  }

  return cfg
}
141138
def load_config(cls, opts, path=None, profile=None):
        """"""
        if path and os.path.exists(path):
            if os.path.isdir(path):
                cls.config_searchpath.insert(0, path)
            else:
                cls.config_files.insert(0, path)

        config = cls.read_config()
        values = config.get("default", {})
        cls._load_values_into_opts(opts, values)

        if profile and profile != "default":
            values = config.get("profile:%s" % profile, {})
            cls._load_values_into_opts(opts, values)

        return values
337262
protected function loadConfig(): void
    {
        $configClass = $this->getConfigClass();
        $configDefinitionClass = $this->getConfigDefinitionClass();
        try {
            $this->config = new $configClass(
                $this->getRawConfig(),
                new $configDefinitionClass()
            );
        } catch (InvalidConfigurationException $e) {
            throw new UserException($e->getMessage(), 0, $e);
        }
    }
350327
def process_settings(pelicanobj):
    """"""

    # Default settings
    inline_settings = {}
    inline_settings['config'] = {'[]':('', 'pelican-inline')}

    # Get the user specified settings
    try:
        settings = pelicanobj.settings['MD_INLINE']
    except:
        settings = None

    # If settings have been specified, add them to the config
    if isinstance(settings, dict):
        inline_settings['config'].update(settings)

    return inline_settings