Loads settings from file.
772612
def _settings_from_file(self):
        """"""
        settings = load_source(
            'settings', text_type(self.user_dir.joinpath('settings.py')))
        return {key: getattr(settings, key)
                for key in const.DEFAULT_SETTINGS.keys()
                if hasattr(settings, key)}
493339
def load_configuration(self, configuration_file):
        '''
        '''
        if os.path.isfile(configuration_file):
            if not isinstance(configuration_file, tb.file.File) and os.path.splitext(configuration_file)[1].strip().lower() != ".h5":
                load_configuration_from_text_file(self, configuration_file)
            else:
                load_configuration_from_hdf5(self, configuration_file)
        else:
            raise ValueError('Cannot find configuration file specified: %s' % configuration_file)
641068
protected function _loadSettings()
    {
        $settings = plugin('Comment')->settings();
        foreach ($settings as $k => $v) {
            $this->config("settings.{$k}", $v);
        }
    }
479440
public void load(String file) {
		Context context = factory.enterContext();
		
		try {
			URL url = Thread.currentThread().getContextClassLoader().getResource(file);
			
			if (url == null) {
				logger.debug("Configuration [" + file + "] does not exist");
				return;
			}
			
			File f = new File(url.getPath());
			
			if (f.exists()) {
				logger.info("Loading configuration [" + file + "]");
				context.evaluateReader(scope, new FileReader(f), file.substring(file.lastIndexOf("/") + 1), 1, null);
			}
			
		} catch (Exception e) {
			logger.error("Failed to load configuration [" + file + "]", e);
			throw new UncheckedException(e);
		} finally {
			Context.exit();
		}
	}
485939
def load(self, text, fieldnames=None):
    """"""
    lines = text.split('\n')
    fieldnames = load_line(lines[0])
    values = load_line(lines[1])
    self.__dict__ = dict(zip(fieldnames, values))
564879
def load_from_file(cls, filename_prefix):
    """"""
    filename = cls._filename(filename_prefix)
    lines, _ = cls._read_lines_from_file(filename)
    # Strip wrapping single quotes
    vocab_list = [line[1:-1] for line in lines]
    return cls(vocab_list=vocab_list)
382295
def load(self):
        
        if self._defaults_file is not None:
            if not os.path.exists(self._defaults_file):
                msg = "Unable to find defaults file: {}".format(self._defaults_file)
                LOGGER.error(msg)
                raise RuntimeError(msg)
            with open(self._defaults_file, 'r') as handle:
                self._defaults = json.load(handle)
                self.update(self._defaults)

        if self._settings_file is None:
            msg = "No context file has been provided"
            LOGGER.error(msg)
            raise RuntimeError(msg)
        if not os.path.exists(self._settings_file):
            msg = "Unable to find settings file: {}".format(self._settings_file)
            LOGGER.error(msg)
            raise RuntimeError(msg)
        with open(self._settings_file, 'r') as handle:
            settings = json.load(handle)
            update(self, settings)

        return
531945
def load_config(files=None, root_path=None, local_path=None):
    """"""

    config = cfg.ConfigOpts()
    config.register_opts([
        cfg.Opt('root_path', default=root_path),
        cfg.Opt('local_path', default=local_path),
    ])
    # XXX register actual config groups here
    # theme_group = config_theme.register_config(config)
    if files is not None:
        config(args=[], default_config_files=files)
    return config
356991
def init(self, args=None):
        """"""
        from .logs import exception

        self._setup_user_dir()
        self._init_settings_file()

        try:
            self.update(self._settings_from_file())
        except Exception:
            exception("Can't load settings from file", sys.exc_info())

        try:
            self.update(self._settings_from_env())
        except Exception:
            exception("Can't load settings from env", sys.exc_info())

        self.update(self._settings_from_args(args))
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)
841913
def load_configuration_from_file(directory, args):
    """"""
    args = copy.copy(args)

    directory_or_file = directory
    if args.config is not None:
        directory_or_file = args.config

    options = _get_options(directory_or_file, debug=args.debug)

    args.report = options.get('report', args.report)
    threshold_dictionary = docutils.frontend.OptionParser.thresholds
    args.report = int(threshold_dictionary.get(args.report, args.report))

    args.ignore_language = get_and_split(
        options, 'ignore_language', args.ignore_language)

    args.ignore_messages = options.get(
        'ignore_messages', args.ignore_messages)

    args.ignore_directives = get_and_split(
        options, 'ignore_directives', args.ignore_directives)

    args.ignore_substitutions = get_and_split(
        options, 'ignore_substitutions', args.ignore_substitutions)

    args.ignore_roles = get_and_split(
        options, 'ignore_roles', args.ignore_roles)

    return args
870225
def load
      close if @loaded

      @path.each do |file|
        next unless File.exist?(file)
        @settings = Psych.load_file(file)
        next unless @settings.include?(@namespace)
        parse(@settings[@namespace])
        @loaded = true
        break
      end

      fail unless @loaded
    end
460235
def load(self, file=CONFIG_FILE):
        
        if not os.path.exists(file):
            print("Config file was not found under %s. Default file has been created" % CONFIG_FILE)
            self._settings = yaml.load(DEFAULT_CONFIG, yaml.RoundTripLoader)
            self.save(file)
            sys.exit()
        with open(file, 'r') as f:
            self._settings = yaml.load(f, yaml.RoundTripLoader)
130720
def _load_defaults(self, default='settings.py'):
        '''
        
        '''
        if default[-3:] == '.py':
            default = default[:-3]

        self.my_settings = {}
        try:
            settings = importlib.import_module(default)
            self.my_settings = self._convert_to_dict(settings)
        except ImportError:
            log.warning("No default settings found")
921161
def load(self, local='localsettings.py', default='settings.py'):
        '''
        
        '''
        self._load_defaults(default)
        self._load_custom(local)

        return self.settings()
607850
private function loadSettings()
    {
        $filename = $this->basedir . '/Settings.php';

        // Check for settings file
        if (!file_exists($filename) || !is_readable($filename)) {
            Throw new FrameworkException('Settings file could not be loaded. Make sure Settings.php exits in projects root dir and is readable.');
        }

        // Load basic config from Settings.php
        $this->settings = include ($filename);

        if (!empty($this->settings['display_errors'])) {
            ini_set('display_errors', 0);
        }
    }
1166461
def __load_settings_from_file(self):
        
        filename = self.get_base_path() + 'settings.json'

        if not exists(filename):
            raise OneLogin_Saml2_Error(
                'Settings file not found: %s',
                OneLogin_Saml2_Error.SETTINGS_FILE_NOT_FOUND,
                filename
            )

        # In the php toolkit instead of being a json file it is a php file and
        # it is directly included
        json_data = open(filename, 'r')
        settings = json.load(json_data)
        json_data.close()

        advanced_filename = self.get_base_path() + 'advanced_settings.json'
        if exists(advanced_filename):
            json_data = open(advanced_filename, 'r')
            settings.update(json.load(json_data))  # Merge settings
            json_data.close()

        return self.__load_settings_from_dict(settings)