Process a configfile, or reload if previously given one.
542845
def load_config(self, configfile=None, override_config=None):
        
        self.config = configobj.ConfigObj()

        # Load in the collector's defaults
        if self.get_default_config() is not None:
            self.config.merge(self.get_default_config())

        if configfile is not None:
            self.configfile = os.path.abspath(configfile)

        if self.configfile is not None:
            config = load_config(self.configfile)

            if 'collectors' in config:
                if 'default' in config['collectors']:
                    self.config.merge(config['collectors']['default'])

                if self.name in config['collectors']:
                    self.config.merge(config['collectors'][self.name])

        if override_config is not None:
            if 'collectors' in override_config:
                if 'default' in override_config['collectors']:
                    self.config.merge(override_config['collectors']['default'])

                if self.name in override_config['collectors']:
                    self.config.merge(override_config['collectors'][self.name])

        self.process_config()
437467
public static void reload(String configFile) {
    	LogLog.debug("Will reload log4j based on config-file " + configFile);
        if (configFile != null) {
            if (configFile.endsWith(XML_FILE_EXENSION)) {
            	LogLog.debug("...using DOMConfigurator.configure()");
            	DOMConfigurator.configure(configFile);

            } else if (configFile.endsWith(".properties")) {
            	LogLog.debug("...using PropertyConfigurator.configure()");
                PropertyConfigurator.configure(configFile);

            }
            if (logger.isInfoEnabled()) {
                logger.info("Reloads log4j configuration: " + configFile);
            }
        }
    }
797107
def load_config_files(name, force=false)
      name = name.to_s

      # Return last config file hash list loaded,
      # if reload is disabled and files have already been loaded.
      return self.cache_config_files[name] if self.reload_disabled? && self.cache_config_files[name]

      logger.info "Loading config files for: #{name}"
      logger.debug "load_config_files(#{name.inspect})"

      # Get current time for checking last loaded status.
      now = Time.now

      # Get array of all the existing files file the config name.
      config_files = self.get_config_files(name)

      # Get all the data from all yaml files into as configs
      configs = config_files.collect do |f|
        name, name_with_suffix, filename, ext, modified_time = * f

        # Get the cached file info the specific file, if
        # it's been loaded before.
        config_data, last_modified, last_loaded = self.cache[filename]

        logger.debug "f = #{f.inspect}\n" +
          "cache #{name_with_suffix} filename      = #{filename.inspect}\n" +
          "cache #{name_with_suffix} config_data   = #{config_data.inspect}\n" +
          "cache #{name_with_suffix} last_modified = #{last_modified.inspect}\n" +
          "cache #{name_with_suffix} last_loaded   = #{last_loaded.inspect}\n"

        # Load the file if its never been loaded or its been more than
        # so many minutes since last load attempt. (default: 5 minutes)
        if config_data.blank? || (now - last_loaded > self.reload_interval)
          if force || config_data.blank? || modified_time != last_modified

            logger.debug "modified_time #{name.inspect} #{filename.inspect} " +
              "changed #{modified_time != last_modified} : #{modified_time.inspect} #{last_modified.inspect}"

            logger.debug "RConfig: loading #{filename.inspect}"

            config_data = read(filename, name, ext)  # Get contents from config file

            logger.debug "RConfig: loaded #{filename.inspect} => #{config_data.inspect}"

            (self.config_loaded ||= {})[name] = config_files  # add files to the loaded files cache

            self.cache[filename] = [config_data, modified_time, now]  # Save cached config file contents, and modified_time.

            logger.debug "cache[#{filename.inspect}] = #{self.cache[filename].inspect}"

            self.cache_hash[name] = nil # Flush merged hash cache.

            self.cache_files[name] = config_files  # Config files changed or disappeared.

          end # if config_data == nil || (now - last_loaded > self.reload_interval)
        end # if force || config_data == nil || modified_time != last_modified

        config_data
      end # config_files.collect
      configs.compact!

      logger.debug "load_config_files(#{name.inspect}) => #{configs.inspect}"

      # Keep last loaded config files around in case self.reload_dsabled.
      self.cache_config_files[name] = configs #unless configs.empty?

      configs
    end
871844
def load(self, file_path):
        '''  '''
        self.clear()
        self.__config = self.read_file(file_path)
919084
def load(self, filename):
        ''' 
        '''
        if not os.path.exists(filename):
            #print 'Could not load config file [%s]' % (filename)
            raise AppConfigValueException('Could not load config file {0}'.
                    format(filename))
        cfl = open(filename, 'r')
        if PY2:
            self.readfp(cfl)
        else:
            self.read_file(cfl)
        cfl.close()
290676
def _load_from_configs(self, filename):
    
    config_filename = os.path.join(self._config_path, filename)
    if os.path.exists(config_filename):
      try:
        f = open(config_filename, 'r')
        content = ''.join(f.readlines())
        f.close()
        return content
      except Exception as err:
        raise err
    else:
      raise IOError("File not found: {}".format(config_filename))
1194123
def reload(*command, ignore_patterns=[]):
    """"""
    path = "."
    sig = signal.SIGTERM
    delay = 0.25
    ignorefile = ".reloadignore"

    ignore_patterns = ignore_patterns or load_ignore_patterns(ignorefile)

    event_handler = ReloadEventHandler(ignore_patterns)
    reloader = Reloader(command, signal)

    observer = Observer()
    observer.schedule(event_handler, path, recursive=True)
    observer.start()

    reloader.start_command()

    try:
        while True:
            time.sleep(delay)
            sys.stdout.write(reloader.read())
            sys.stdout.flush()
            if event_handler.modified:
                reloader.restart_command()
    except KeyboardInterrupt:
        observer.stop()
    observer.join()

    reloader.stop_command()
    sys.stdout.write(reloader.read())
    sys.stdout.flush()
416669
def process_data(self, file_info):
        """"""
        if self._is_already_processed(file_info):
            self.log.debug("Content file already processed '%s'", str(file_info))
            self.fire(events.FilteredFile(file_info))
            self.fire(events.FileInfoAlreadyProcessed(file_info))
        else:
            return file_info
        return None
1212469
def load(self, cfgFile=None, timeout=None):
        """"""
        #if cfgFile != None: self.cfgFile = cfgFile # if it's specified, use it
        if not cfgFile:
            cfgs = activeConfigs()
            if   len(cfgs) > 1: raise Exception("found too many configurations (%s); not clear which to load: %s"%(len(cfgs), cfgs))
            elif len(cfgs) < 1:
                if timeout: # wait for a configuration file to appear to be loaded
                    startWait = time.time()
                    timeReported = 0
                    while not cfgs:
                        timeWaited = time.time() - startWait
                        if timeWaited > timeout:
                            raise c.TimeoutExceeded("could not join game after %s seconds"%(timeout))
                        try:  cfgs = activeConfigs()
                        except:
                            if self.debug and timeWaited - timeReported >= 1:
                                timeReported += 1
                                print("second(s) waited for game to appear:  %d"%(timeReported))
                else:  raise Exception("must have a saved configuration to load or allow loading via timeout setting")
            cfgFile = cfgs.pop()
        try:
            with open(cfgFile, "rb") as f:
                data = f.read() # bytes => str
        except TypeError as e:
            print("ERROR %s: %s %s"%(e, cfgFile, type(cfgFile)))
            raise
        self.loadJson(data) # str => dict
        if self.debug:
            print("configuration loaded: %s"%(self.name))
            self.display()
471208
def process(self):
        """"""
        temp_filename = self.create_file_for(self.config.script)

        if len(self.config.title) > 0:
            self.logger.info(render(self.config.title, model=self.config.model, env=self.env,
                                    item=self.config.item, variables=self.config.variables))

        if temp_filename is not None:
            try:
                for line in self.process_file(temp_filename):
                    yield line
            finally:
                # removing script
                os.remove(temp_filename)

        if not self.config.internal:
            if self.exit_code == 0:
                self.event.succeeded()
            else:
                self.event.failed(exit_code=self.exit_code)
228910
public static synchronized void reloadExistingConfigurations() {
		if (LOG.isDebugEnabled()) {
			LOG.debug("Reloading " + REGISTRY.keySet().size()
					+ " existing configurations");
		}
		for (Configuration conf : REGISTRY.keySet()) {
			conf.reloadConfiguration();
		}
	}
1104701
def LoadCheckFromFile(file_path, check_id, overwrite_if_exists=True):
  """"""
  configs = LoadConfigsFromFile(file_path)
  conf = configs.get(check_id)
  check = Check(**conf)
  check.Validate()
  CheckRegistry.RegisterCheck(
      check,
      source="file:%s" % file_path,
      overwrite_if_exists=overwrite_if_exists)
  logging.debug("Loaded check %s from %s", check.check_id, file_path)
  return check
1197072
def _load_values(self):
        """"""
        path = self._config_path()
        if path is not None and os.path.isfile(path):
            self._load_file(path)
15920
def load_conf(fn=None):
    
    if fn is None:
        fn = cfile()
    if os.path.isfile(fn):
        with open(fn) as f:
            try:
                conf.update(yaml_load(f))
            except Exception as e:
                logger.warning('Failure to load config file "{fn}": {e}'
                               ''.format(fn=fn, e=e))
1261225
def reload(file = nil)
      clear_all
      if file
        read file
        return true
      end
      read_global
      read_user
      return true
    end
50650
def load_or_create_config(self, filename, config=None):
        """"""
        os.makedirs(os.path.dirname(os.path.expanduser(filename)), exist_ok=True)
        if os.path.exists(filename):
            return self.load(filename)

        if(config == None):
            config = self.random_config()

        self.save(filename, config)
        return config
1031536
function _load() {
  if (!existsSync(exports.configFile)) {
    _initFile();
  }

  try {
    return JSON.parse(fs.readFileSync(exports.configFile, 'utf8'));
  }
  catch (e) {
    console.error('JSON parse error');
    console.error('See and edit', exports.configFile);
    console.error('or exec `confy clean`');
    process.exit();
  }
}