Get a app config value by name
433899
def get(self, key, subcommand="config:get"):
        """"""
        cmd = ["heroku", subcommand, key, "--app", self.name]
        return self._result(cmd)
675361
def get_model_config_value(self, obj, name):
        """"""
        config = models_config.get_config(obj)
        return getattr(config, name)
566146
def get_enabled(name, app):
    '''
    
    '''
    plugins = app.config['PLUGINS']
    return dict(_ep_to_kv(e) for e in iter_all(name) if e.name in plugins)
52039
def get_by_name(config=None, name=None, name_label='name'):
        

        if name is None:
            raise SyntaxError(
                'Deployment: name: [ {0} ] cannot be None.'.format(name))
        if not isinstance(name, str):
            raise SyntaxError(
                'Deployment: name: [ {0} ] must be a string.'.format(name))

        if config is not None and not isinstance(config, K8sConfig):
            raise SyntaxError(
                'Deployment: config: [ {0} ] must be a K8sConfig'.format(config))

        deps = K8sDeployment(config=config, name=name).list(labels={
            name_label: name
        })

        return deps
304120
function list(appName, callback) {
    var url = format('/%s/apps/%s/config/', deis.version, appName);
    commons.get(url, function onListResponse(err, result) {
      callback(err, result ? result.tags : null);
    });
  }
1104718
def find_value(self, key):
        """"""
        values = self.values
        if key not in values:
            raise AttributeError("Config has no value for {}".format(key))

        val = values[key]
        if isinstance(val, Default):
            return val.val
        else:
            return val
174234
function select(name, outfilename) {
        var regex = /\$tiapp\.(.*)\$/;

        if (!name) {
            if (fs.existsSync('./app/config.json')) {
                var alloyCfg = JSON.parse(fs.readFileSync("./app/config.json", "utf-8"));
                if (alloyCfg.global.theme) {
                    console.log('\nFound a theme in config.json, trying ' + chalk.cyan(alloyCfg.global.theme));
                    select(alloyCfg.global.theme);
                } else {
                    status();
                }
            }
        } else {
            // find the config name specified
            cfg.configs.forEach(function(config) {

                if (config.name === name) {
                    console.log('\nFound a config for ' + chalk.cyan(config.name) + '\n');
                    if (fs.existsSync('./app/config.json')) {
                        var alloyCfg = JSON.parse(fs.readFileSync("./app/config.json", "utf-8"));
                        if (alloyCfg.global.theme) {
                          var original = alloyCfg.global.theme;
                          alloyCfg.global.theme = name;
                          fs.writeFile("./app/config.json", JSON.stringify(alloyCfg, null, 2), function (err) {
                              if (err) return console.log(err);
                              console.log('\nChanging theme value in config.json from ' + chalk.cyan(original) + ' to ' + chalk.cyan(name));
                          });
                        }
                    }

                    for (var setting in config.settings) {

                        if (!config.settings.hasOwnProperty(setting)) continue;

                        if (setting != "properties" && setting != "raw") {

							var now = new Date();
                            var replaceWith = config.settings[setting]
                                .replace('$DATE$', now.toLocaleDateString())
                                .replace('$TIME$', now.toLocaleTimeString())
                                .replace('$DATETIME$', now.toLocaleString())
                                .replace('$TIME_EPOCH$', now.getTime().toString());

                            var matches = regex.exec(replaceWith);

                            if (matches && matches[1]) {
                                var propName = matches[1];
                                replaceWith = replaceWith.replace(regex, tiapp[propName]);
                            }

                            tiapp[setting] = replaceWith;

                            console.log('Changing ' + chalk.cyan(setting) + ' to ' + chalk.yellow(replaceWith));
                        }

                    }

                    if (config.settings.properties) {
                        for (var property in config.settings.properties) {

                            if (!config.settings.properties.hasOwnProperty(property)) continue;

                            var replaceWith = config.settings.properties[property]
                                .replace('$DATE$', new Date().toLocaleDateString())
                                .replace('$TIME$', new Date().toLocaleTimeString())
                                .replace('$DATETIME$', new Date().toLocaleString())
                                .replace('$TIME_EPOCH$', new Date().getTime().toString());


                            var matches = regex.exec(replaceWith);
                            if (matches && matches[1]) {
                                var propName = matches[1];
                                replaceWith = replaceWith.replace(regex, tiapp[propName]);
                            }

                            tiapp.setProperty(property, replaceWith);

                            console.log('Changing App property ' + chalk.cyan(property) + ' to ' + chalk.yellow(replaceWith));

                        }
                    }

                    if (config.settings.raw) {
                        var doc = tiapp.doc;
                        var select = xpath.useNamespaces({
                            "ti": "http://ti.appcelerator.org",
                            "android": "http://schemas.android.com/apk/res/android"
                        });
                        for (var path in config.settings.raw) {

                            if (!config.settings.raw.hasOwnProperty(path)) continue;

                            var node = select(path, doc, true);
                            if (!node) {
                                console.log(chalk.yellow('Could not find ' + path + ", skipping"));
                                continue;
                            }

                            var replaceWith = config.settings.raw[path]
                                .replace('$DATE$', new Date().toLocaleDateString())
                                .replace('$TIME$', new Date().toLocaleTimeString())
                                .replace('$DATETIME$', new Date().toLocaleString())
                                .replace('$TIME_EPOCH$', new Date().getTime().toString());


                            var matches = regex.exec(replaceWith);
                            if (matches && matches[1]) {
                                var propName = matches[1];
                                replaceWith = replaceWith.replace(regex, tiapp[propName]);
                            }



                            if (typeof(node.value) === 'undefined'){
                                node.firstChild.data = replaceWith;
                            }
                            else{
                                node.value = replaceWith;
                            }

                            console.log('Changing Raw property ' + chalk.cyan(path) + ' to ' + chalk.yellow(replaceWith));

                        }
                    }

                    if (fs.existsSync("./app/themes/" + name + "/assets/iphone/DefaultIcon.png")) {
                        // if it exists in the themes folder, in a platform subfolder
                        console.log(chalk.blue('Found a DefaultIcon.png in the theme\'s assets/iphone folder\n'));
                        copyFile("./app/themes/" + name + "/assets/iphone/DefaultIcon.png", "./DefaultIcon.png")
                    } else if (fs.existsSync("./app/themes/" + name + "/DefaultIcon.png")) {
                        // if it exists in the top level theme folder
                        console.log(chalk.blue('Found a DefaultIcon.png in the theme folder\n'));
                        copyFile("./app/themes/" + name + "/" + "/DefaultIcon.png", "./DefaultIcon.png")
                    }

                    console.log(chalk.green('\n' + outfilename + ' updated\n'));

                    tiapp.write(outfilename);

                }
            });

            //console.log(chalk.red('\nCouldn\'t find a config called: ' + name + '\n'));

        }
    }
419349
def get_config_value(self, k, i):
        """"""
        if(not isinstance(self.store[k], list)):
            return self.store[k]
        else:
            return self.store[k][i]
162749
@Override
    public Object getValue(String name)
    {
        Object value = super.getValue(name);
        if (value != null)
        {
            return value;
        }
        else
        {
            return configMap.get(name);
        }
    }
588437
def init_app(self, app):
        """"""
        prefix_len = len(self.prefix)
        for varname, value in os.environ.items():
            if not varname.startswith(self.prefix):
                continue

            # Prepare values
            varname = varname[prefix_len:]
            value = value or app.config.get(varname)

            # Evaluate value
            try:
                value = ast.literal_eval(value)
            except (SyntaxError, ValueError):
                pass

            # Set value
            app.config[varname] = value
571248
def config(key, default=None):
    
    return Mocha._app.config.get(key, default) if Mocha._app else default
752269
def get_by_name(self, name):
        """"""
        for section in self.values():
            for preference in section.values():
                if preference.name == name:
                    return preference
        raise NotFoundInRegistry("No such preference in {0} with name={1}".format(
            self.__class__.__name__, name))
1026692
def get(name)
      if respond_to?(name)
        send(name)
      elsif Configuration.setting_name_to_property(name)
        send Configuration.setting_name_to_property(name)
      else
        build_settings[name]
      end
    end
653825
def locate_config(confname, app_name,
                  location=None, prefix='etc', verbose=False):
    
    candidates = []
    if location:
        candidate = os.path.normpath(os.path.join(location, confname))
        if os.path.isfile(candidate):
            candidates += [candidate]
    candidate = os.path.normpath(os.path.join(
        os.path.dirname(os.path.dirname(sys.executable)),
        prefix, app_name, confname))
    if os.path.isfile(candidate):
        candidates += [candidate]
    candidate = os.path.normpath('/%s/%s/%s' % (prefix, app_name, confname))
    if os.path.isfile(candidate):
        candidates += [candidate]
    candidate = os.path.normpath(os.path.join(os.getcwd(), confname))
    if os.path.isfile(candidate):
        candidates += [candidate]
    if candidates:
        if verbose:
            LOGGER.info("config loaded from '%s'", candidates[0])
        return candidates[0]
    else:
        LOGGER.warning("config '%s' was not found.", confname)
    return None
1194541
async def set_config(cls, name: str, value):
        
        return await cls._handler.set_config(name=[name], value=[value])
680080
def _config(name, key=None, **kwargs):
    '''
    
    '''
    if key is None:
        key = name
    if name in kwargs:
        value = kwargs[name]
    else:
        value = __salt__['config.option']('ddns.{0}'.format(key))
        if not value:
            value = None
    return value
568507
def _get_app_version(self, app_config):
        

        base_name = app_config.__module__.split('.')[0]
        module = __import__(base_name)
        return getattr(module, '__version__', 'N/A')