Retrieves the config.xml's pereferences for a given platform and parses them into JSON data
979423
function parsePlatformPreferences(configData, platform) {
        var preferences = getPlatformPreferences(platform);
        switch(platform){
            case "ios":
                parseiOSPreferences(preferences, configData);
                break;
            case "android":
                parseAndroidPreferences(preferences, configData);
                break;
        }
    }
737288
function PlatformInfo(PlatformCtor, platformId) {

    this._Ctor = PlatformCtor;
    this._platformId = platformId;

    // Prefix all platform-specific args with the platform name
    var argSpec = PlatformCtor.getArgs ? PlatformCtor.getArgs() : {};
    this._argSpec = {};
    for (var cmd in argSpec) {
        var cmdArgSpec = argSpec[cmd];
        var platformCmdArgSpec = {};
        for (var key in cmdArgSpec) {
            platformCmdArgSpec["--" + platformId + "-" + key] = cmdArgSpec[key];
        }
        this._argSpec[cmd] = platformCmdArgSpec;
    }

    // Look for platforms env vars
    this._envSpec = PlatformCtor.getEnv ? PlatformCtor.getEnv() : {};
}
1059270
def get_config():
  """"""
  # TODO(hanuszczak): See comment in `setup.py` for `grr-response-proto`.
  ini_path = os.path.join(THIS_DIRECTORY, "version.ini")
  if not os.path.exists(ini_path):
    ini_path = os.path.join(THIS_DIRECTORY, "../../version.ini")
    if not os.path.exists(ini_path):
      raise RuntimeError("Couldn't find version.ini")

  config = configparser.SafeConfigParser()
  config.read(ini_path)
  return config
683773
function setPlatformConfig(platformName, platformConfigs) {
    configProperties.platform[platformName] = platformConfigs;
    provider.platform[platformName] = {};

    addConfig(configProperties, configProperties.platform[platformName]);

    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');
  }
642554
def load_xml_conf(self, xml_file, id):
        '''
        
        '''

        # converting nutch-site.xml to key:value pairs
        import xml.etree.ElementTree as ET
        tree = ET.parse(xml_file)
        params = {}
        for prop in tree.getroot().findall(".//property"):
            params[prop.find('./name').text.strip()] = prop.find('./value').text.strip()
        return self.proxy.Configs().create(id, configData=params)
39272
def _getThirdPartyLibs(self, platformIdentifier, configuration):
		
		
		# If we have previously cached the library list for the current engine version, use the cached data
		cachedList = CachedDataManager.getCachedDataKey(self.engineVersionHash, 'ThirdPartyLibraries')
		if cachedList != None:
			return cachedList
		
		# Create a temp directory to hold the JSON file
		tempDir = tempfile.mkdtemp()
		jsonFile = os.path.join(tempDir, 'ubt_output.json')
		
		# Installed Builds of the Engine only contain a small handful of third-party libraries, rather than the full set
		# included in a source build of the Engine. However, if the ThirdParty directory from a source build is copied
		# into an Installed Build and the `InstalledBuild.txt` sentinel file is temporarily renamed, we can get the best
		# of both worlds and utilise the full set of third-party libraries. Enable this sentinel renaming behaviour only
		# if you have copied the ThirdParty directory from a source build into your Installed Build, or else the UBT
		# command will fail trying to rebuild UnrealHeaderTool.
		sentinelFile = os.path.join(self.engineRoot, 'Engine', 'Build', 'InstalledBuild.txt')
		sentinelBackup = sentinelFile + '.bak'
		renameSentinel = os.path.exists(sentinelFile) and os.environ.get('UE4CLI_SENTINEL_RENAME', '0') == '1'
		if renameSentinel == True:
			shutil.move(sentinelFile, sentinelBackup)
		
		# Invoke UnrealBuildTool in JSON export mode (make sure we specify gathering mode, since this is a prerequisite of JSON export)
		# (Ensure we always perform sentinel file cleanup even when errors occur)
		try:
			args = ['-Mode=JsonExport', '-OutputFile=' +jsonFile ] if self.engineVersion['MinorVersion'] >= 22 else ['-gather', '-jsonexport=' + jsonFile, '-SkipBuild']
			self.runUBTFunc('UE4Editor', platformIdentifier, configuration, args)
		finally:
			if renameSentinel == True:
				shutil.move(sentinelBackup, sentinelFile)
		
		# Parse the JSON output
		result = json.loads(Utility.readFile(jsonFile))
		
		# Extract the list of third-party library modules
		# (Note that since UE4.21, modules no longer have a "Type" field, so we must
		# rely on the "Directory" field filter below to identify third-party libraries)
		modules = [result['Modules'][key] for key in result['Modules']]
		
		# Filter out any modules from outside the Engine/Source/ThirdParty directory
		thirdPartyRoot = os.path.join(self.engineRoot, 'Engine', 'Source', 'ThirdParty')
		thirdparty = list([m for m in modules if thirdPartyRoot in m['Directory']])
		
		# Remove the temp directory
		try:
			shutil.rmtree(tempDir)
		except:
			pass
		
		# Cache the list of libraries for use by subsequent runs
		CachedDataManager.setCachedDataKey(self.engineVersionHash, 'ThirdPartyLibraries', thirdparty)
		
		return thirdparty
1266558
function readOptions(ctx) {
  var configFilePath = path.join(ctx.opts.projectRoot, 'config.xml');
  var configXmlContent = xmlHelper.readXmlAsJson(configFilePath, true);

  return parseConfig(configXmlContent);
}
165360
function injectOptions(options) {
  platforms.forEach(function(platform) {
    var configXmlFilePath = getPlatformSpecificConfigXml(platform);
    if (configXmlFilePath == null) {
      return;
    }

    // read data from config.xml
    var configData = xmlHelper.readXmlAsJson(configXmlFilePath);
    if (configData == null) {
      console.warn('Configuration file ' + configXmlFilePath + ' not found');
      return;
    }

    // inject new options
    var chcpXmlConfig = {};
    for (var preferenceName in options) {
      injectPreference(chcpXmlConfig, preferenceName, options[preferenceName]);
    }

    // write them back to config.xml
    configData.widget['chcp'] = [];
    configData.widget.chcp.push(chcpXmlConfig);
    xmlHelper.writeJsonAsXml(configData, configXmlFilePath);
  });
}
522514
def getConfiguration(configPath = None):
    
    if configPath == None:
        # If a current.cfg has not been found, creating it by copying from default
        configPath = getConfigPath("browser.cfg")

    # Checking if the configuration file exists
    if not os.path.exists(configPath):
        try:
            # Copy the data from the default folder
            defaultConfigPath = getConfigPath(os.path.join("default", "browser.cfg"))
     
            with open(configPath, "w") as oF:
                with open(defaultConfigPath) as iF:
                    cont = iF.read()
                    oF.write(cont)    
                                                
        except Exception, e:
            errMsg = "ERROR. No configuration file could be found and the default file was not found either. You might need to reset it manually."
            raise Exception( errMsg + " " + str(e))      

    try:
        # Reading the configuration file
        config = ConfigParser.ConfigParser()
        config.read(configPath)

        info = {}

        # Iterating through all the sections, which contain the platforms
        for section in config.sections():
            current = {}
            # Iterating through parametgers
            for (param, value) in config.items(section):
                current[param] = value
                
            # Loading the configuration in the info dictionary
            info[section] = current
            
    except Exception, e:
        errMsg = "ERROR. Something happened when processing the Configuration file (some kind of malform?). Check it before running it again."
        raise Exception( errMsg + " " + str(e))      

    return info
1261316
def get_config(repo):
    
    files = get_files(repo)
    config = DEFAULT_CONFIG
    if "config.json" in files:
        # get the config file, parse JSON and merge it with the default config
        config_file = repo.get_file_contents('/config.json', ref="gh-pages")
        try:
            repo_config = json.loads(config_file.decoded_content.decode("utf-8"))
            config.update(repo_config)
        except ValueError:
            click.secho("WARNING: Unable to parse config file. Using defaults.", fg="yellow")
    return config
1373606
function (platform) {
            var configData = this.parseConfigXml(platform),
                platformPath = path.join(rootdir, 'platforms', platform);

            _.each(configData, function (configItems, targetFileName) {
                var projectName, targetFile;

                if (platform === 'ios' && targetFileName.indexOf("Info.plist") > -1) {
                    projectName = platformConfig.getConfigXml().findtext('name');
                    targetFile = path.join(platformPath, projectName, projectName + '-Info.plist');
                    platformConfig.updateIosPlist(targetFile, configItems);
                } else if (platform === 'android' && targetFileName === 'AndroidManifest.xml') {
                    targetFile = path.join(platformPath, targetFileName);
                    platformConfig.updateAndroidManifest(targetFile, configItems);
                }
            });
        }
950017
def get_platform():
    
    platform_data = {
        'os_name': None,
        'os_bits': None
    }
    os_name = platform.system()
    normalize_os = {
        'Windows': 'windows',
        'Linux': 'linux',
        'Darwin': 'mac'
    }
    if os_name in normalize_os.keys():
        platform_data['os_name'] = normalize_os[os_name]
    else:
        raise Exception('Could not normalize os name {}'.format(os_name))
    # try to get the os bits
    maxsize = sys.maxsize
    if maxsize == EXPECTED_MAXSIZE_32:
        platform_data['os_bits'] = '32'
    elif maxsize == EXPECTED_MAXSIZE_64:
        platform_data['os_bits'] = '64'
    else:
        platform_data['os_bits'] = '64'
        logger.warning('could not determine os bits, setting default to 64')
    return platform_data
75941
def _get_config():
    '''
    
    '''
    cfg = os.path.expanduser('~/.dockercfg')
    try:
        fic = open(cfg)
        try:
            config = json.loads(fic.read())
        finally:
            fic.close()
    except Exception:
        config = {'rootPath': '/dev/null'}
    if not 'Configs' in config:
        config['Configs'] = {}
    return config
593664
def fetch_platform_informations(self, callback):
        

        self._protocolVersion = -1
        self._callback = callback

        self._request_protocol_version()
874526
def get_config(config_file=None, config_values=None, load_project_conf=True):
    """"""
    config_values = config_values or {}
    config_settings = {}

    default_conf = _get_default_conf()
    user_conf = _get_user_conf(config_file) if config_file else {}
    # load project configuration only when user configuration was not specified
    project_conf = {} if user_conf or not load_project_conf else _get_project_conf()

    if not (user_conf or project_conf or config_values):
        if load_project_conf:
            raise Dump2PolarionException(
                "Failed to find configuration file for the project "
                "and no configuration file or values passed."
            )
        raise Dump2PolarionException("No configuration file or values passed.")

    # merge configuration
    config_settings.update(default_conf)
    config_settings.update(user_conf)
    config_settings.update(project_conf)
    config_settings.update(config_values)

    _populate_urls(config_settings)
    _set_legacy_project_id(config_settings)
    _set_legacy_custom_fields(config_settings)
    _check_config(config_settings)

    return config_settings
955256
def get_config(self):
        
        config = {
            'location': self.location,
            'language': self.language,
            'topic': self.topic,
        }
        return config
892279
function (rootdir, platform) {
        var configXml = lib.getConfigXml(rootdir);

        //init common config.xml prefs if we haven't already
        var preferencesData = {
            common: configXml.findall('preference')
        };

        var prefs = preferencesData.common || [];
        if (platform) {
            if (!preferencesData[platform]) {
                preferencesData[platform] = configXml.findall('platform[@name=\'' + platform + '\']/preference');
            }
            prefs = prefs.concat(preferencesData[platform]);
        }

        return prefs;
    }