Lookup config value.
436511
def lookup(self, section, name):
        """"""
        value = os.environ.get('AMAAS_{}'.format(name.upper()))
        if value:
            return value

        try:
            value = self.file_config.get(section, name)
        except ConfigParserError:
            pass
        else:
            if value:
                return value

        raise MissingConfigurationError(section, name)
11775
def read_config(cls, configparser):
        """"""
        config = dict()
        section = cls.__name__
        option = "prefixes"
        if configparser.has_option(section, option):
            value = configparser.get(section, option)
            names = [x.strip().lower() for x in value.split(",")]
        else:
            names = []
        config[option] = names
        return config
354897
def enter_config_value(self, key, default=""):
        ''' 
        '''
        value = input('Please enter a value for ' + key + ': ')
        if value:
            return value
        else:
            return default
1032104
def get_custom_values(self, key):
        """"""
        self._handled.add(key)
        return self._lookup[key]
1200486
def _get_value_from_config(self, section, name):
        """"""

        conf = configuration.get_config()

        try:
            value = conf.get(section, name)
        except (NoSectionError, NoOptionError, KeyError):
            return _no_value

        return self.parse(value)
1268381
def read(config_values):
    """"""
    if not config_values:
        raise RheaError('Cannot read config_value: `{}`'.format(config_values))

    config_values = to_list(config_values)

    config = {}
    for config_value in config_values:
        config_value = ConfigSpec.get_from(value=config_value)
        config_value.check_type()
        config_results = config_value.read()
        if config_results and isinstance(config_results, Mapping):
            config = deep_update(config, config_results)
        elif config_value.check_if_exists:
            raise RheaError('Cannot read config_value: `{}`'.format(config_value))

    return config
1072112
def config_present(name, value):
    '''
    

    '''
    name = name.lower()
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    # load confiration
    config = _load_config()

    # handle bool and None value
    if isinstance(value, (bool)):
        value = 'true' if value else 'false'
    if not value:
        value = ""

    if name in config:
        if six.text_type(config[name]) == six.text_type(value):
            # we're good
            ret['result'] = True
            ret['comment'] = 'property {0} already has value "{1}"'.format(name, value)
        else:
            # update property
            ret['result'] = True
            ret['comment'] = 'updated property {0} with value "{1}"'.format(name, value)
            ret['changes'][name] = value
            config[name] = value
    else:
        # add property
        ret['result'] = True
        ret['comment'] = 'added property {0} with value "{1}"'.format(name, value)
        ret['changes'][name] = value
        config[name] = value

    # apply change if needed
    if not __opts__['test'] and ret['changes']:
        ret['result'] = _write_config(config)

    return ret
949405
def validate(self):
        """"""
        missing = []
        for k, v in self._map.items():
            attr = getattr(self, k, False)
            if not attr or attr == CONFIG_PLACEHOLDER:
                missing.append(v)
        if missing:
            return "Missing or invalid config values: {}".format(
                ", ".join(sorted(missing))
            )
798432
def get(args):
    """"""
    from . import config
    for key in args.key.split("."):
        config = getattr(config, key)
    print(json.dumps(config))
865405
def config_load(ctx, param, value):
    """"""
    if ctx.obj is None:
        ctx.obj = {}

    ctx.obj['config_path'] = value
    ctx.obj['config'] = read_config(value)
    return value
1148965
def get_config_value(self, name, defaultValue):
    
    self.send_get_config_value(name, defaultValue)
    return self.recv_get_config_value()
361870
def get_config_path(filename, *search_dirs):
    """"""
    paths = config_search_paths(filename, *search_dirs)

    for path in paths[::-1]:
        if os.path.exists(path):
            return path
160544
def configured_options(self):
        """"""
        stdout_lines = self._check_output(['config', '--list']).splitlines()
        return {key: value for key, value in [line.split('=') for line in stdout_lines]}
234741
def config(env=DEFAULT_ENV, default='locmem://'):
    """"""
    config = {}

    s = os.environ.get(env, default)

    if s:
        config = parse(s)

    return config
735756
def value(self):
        """"""
        val = {}
        for k in self.__allowed_keys:
            value = getattr(self, "_" + k)
            if value is not None:
                val[k] = value
        return val
663464
def _name_lookup(names):
    """
    mapper = dict(zip(range(len(names)), names))

    def lookup(val):
        return mapper.get(val, 'Unknown')
    return lookup
188547
def get_values(self):
        """"""
        for value_name, widget in self.index.items():
            self.value[value_name] = widget.get_value(self.value[value_name])

            setting_name = self.widget + '/' + value_name
            settings.setValue(setting_name, self.value[value_name])