Access process configuarion values as attributes.
555418
def metadata(self):
        
        from ambry.metadata.schema import Top  # cross-module import
        top = Top()
        top.build_from_db(self.dataset)
        return top
228121
def to_dict(self):
        """"""
        config = {}
        for attr in dir(self):
            if not attr.startswith('_'):
                value = getattr(self, attr)
                if not hasattr(value, '__call__'):
                    config[attr] = value
        return config
724711
def retrieveVals(self):
        """"""
        fpminfo = PHPfpmInfo(self._host, self._port, self._user, self._password, 
                             self._monpath, self._ssl)
        stats = fpminfo.getStats()
        if self.hasGraph('php_fpm_connections') and stats: 
            self.setGraphVal('php_fpm_connections', 'conn', 
                             stats['accepted conn'])
        if self.hasGraph('php_fpm_processes') and stats: 
            self.setGraphVal('php_fpm_processes', 'active', 
                             stats['active processes'])
            self.setGraphVal('php_fpm_processes', 'idle', 
                             stats['idle processes'])
            self.setGraphVal('php_fpm_processes', 'total', 
                             stats['total processes'])
90519
def get_values(self, config_manager, ignore_mismatches, obj_hook=DotDict):
        """"""
        if self.delayed_parser_instantiation:
            try:
                app = config_manager._get_option('admin.application')
                source = "%s%s" % (app.value.app_name, file_name_extension)
                self.config_obj = configobj.ConfigObj(source)
                self.delayed_parser_instantiation = False
            except AttributeError:
                # we don't have enough information to get the ini file
                # yet.  we'll ignore the error for now
                return obj_hook()  # return empty dict of the obj_hook type
        if isinstance(self.config_obj, obj_hook):
            return self.config_obj
        return obj_hook(initializer=self.config_obj)
1290790
def _settings_from_env(self):
        """"""
        return {attr: self._val_from_env(env, attr)
                for env, attr in const.ENV_TO_ATTR.items()
                if env in os.environ}
232263
def get_parameters(self):
        """"""
        parameter_names = self.PARAMETERS.keys()
        # TODO: Unresolved reference for processor
        parameter_values = [getattr(processor, n) for n in parameter_names]
        return dict(zip(parameter_names, parameter_values))
242193
def _GenConfig(self, cfg):
    """"""
    # Some setting names may have a + or - suffix. These indicate that the
    # settings modify the default values.
    merged = self.default.copy()
    for setting, vals in iteritems(cfg):
      option, operator = (setting.split(None, 1) + [None])[:2]
      vals = set(vals)
      default = set(self.default.get(option, []))
      # If there is an operator, updated values accordingly.
      if operator == "+":
        vals = default.union(vals)
      elif operator == "-":
        vals = default.difference(vals)
      merged[option] = list(vals)
    return rdf_protodict.AttributedDict(**merged)
675509
def read_configuration(self):
        """"""
        self.configured = True
        # Default backend needs to be the database backend for backward
        # compatibility.
        backend = (getattr(settings, 'CELERY_RESULT_BACKEND', None) or
                   getattr(settings, 'CELERY_BACKEND', None))
        if not backend:
            settings.CELERY_RESULT_BACKEND = 'database'
        return DictAttribute(settings)
1081420
def environment_variables
      vars = @process.environment_variables.merge({
        'PROC_NAME' => self.description,
        'PID_FILE' => self.pid_file_path,
        'APP_ROOT' => @process.config.root
      })
      vars['PORT'] = @port.to_s if @port
      vars
    end
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]
121466
def get_settings(infile):
    
    settings = yaml.load(_as_file(infile))
    if not hasattr(settings, 'keys'):
        raise ValueError("Settings not found in {}".format(infile))

    # Processing of namespaced parameters in .pmgrc.yaml.
    processed_settings = {}
    for k, v in settings.items():
        if k.startswith("PMG_DB_"):
            processed_settings[k[7:].lower()] = v
        else:
            processed_settings[k] = v
    auth_aliases(processed_settings)
    return processed_settings
7690
def retrieveVals(self):
        """"""
        proc_info = ProcessInfo()
        stats = {}
        for (prefix, is_thread) in (('proc', False), 
                                    ('thread', True)):
            graph_name = '%s_status' % prefix
            if self.hasGraph(graph_name):
                if not stats.has_key(prefix):
                    stats[prefix] = proc_info.getProcStatStatus(is_thread)
                for (fname, stat_key) in (
                    ('unint_sleep', 'uninterruptable_sleep'),
                    ('stopped', 'stopped'),
                    ('defunct', 'defunct'),
                    ('running', 'running'),
                    ('sleep', 'sleep')):
                    self.setGraphVal(graph_name, fname, 
                                     stats[prefix]['status'].get(stat_key))
            graph_name = '%s_prio' % prefix
            if self.hasGraph(graph_name):
                if not stats.has_key(prefix):
                    stats[prefix] = proc_info.getProcStatStatus(is_thread)
                for (fname, stat_key) in (
                    ('high', 'high'),
                    ('low', 'low'),
                    ('norm', 'norm'),
                    ('locked', 'locked_in_mem')):
                    self.setGraphVal(graph_name, fname, 
                                     stats[prefix]['prio'].get(stat_key))
482616
def get():
        """"""
        return {
            attr: getattr(Conf, attr)
            for attr in dir(Conf()) if not callable(getattr(Conf, attr)) and not attr.startswith("__")
        }
834479
def _imm_init_getattribute(self, name):
    '''
    
    '''
    values = _imm_value_data(self)
    params = _imm_param_data(self)
    if name in values:
        _imm_init_to_trans(self)
        return getattr(self, name)
    elif name in params:
        dd = object.__getattribute__(self, '__dict__')
        if name in dd: return dd[name]
        else: raise RuntimeError('Required immutable parameter %s requested before set' % name)
    else:
        # if they request a required param before it's set, raise an exception; that's fine
        return object.__getattribute__(self, name)
211049
public void parseProcessDefinitions() {
    for (Element processElement : rootElement.elements("process")) {
      boolean isExecutable = !deployment.isNew();
      String isExecutableStr = processElement.attribute("isExecutable");
      if (isExecutableStr != null) {
        isExecutable = Boolean.parseBoolean(isExecutableStr);
        if (!isExecutable) {
          LOG.ignoringNonExecutableProcess(processElement.attribute("id"));
        }
      } else {
        LOG.missingIsExecutableAttribute(processElement.attribute("id"));
      }

      // Only process executable processes
      if (isExecutable) {
        processDefinitions.add(parseProcess(processElement));
      }
    }
  }
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
250633
def process_app_config_section(config, app_config):
    
    if 'addresses' in app_config:
        config.app['addresses'] = app_config['addresses']
    if 'component' in app_config:
        config.app['component'] = app_config['component']
    if 'data' in app_config:
        if 'sources' in app_config['data']:
            config.app['data']['sources'] = app_config['data']['sources']
    if 'id' in app_config:
        config.app['id'] = app_config['id']
    if 'login' in app_config:
        if 'urls' in app_config['login']:
            for url in app_config['login']['urls']:
                config.app['login']['urls'][url['name']] = url['value']
    if 'pythonpath' in app_config:
        config.app['pythonpath'] = app_config['pythonpath']
    if 'port' in app_config:
        config.app['port'] = app_config['port']
    if 'process' in app_config:
        if 'num_processes' in app_config['process']:
            config.app['process']['num_processes'] = app_config[
                'process']['num_processes']
    if 'url_root_path' in app_config:
        root_url = app_config['url_root_path'].strip()
        if root_url[0] == "/":
            root_url = root_url[1:]
        if root_url == "":
            root_url = None
        config.app['url_root_path'] = root_url
    if 'settings' in app_config:
        config.app['settings'] = app_config['settings']
    if 'socket' in app_config:
        config.app['socket'] = app_config['socket']
    if 'static_path' in app_config:
        config.app['static_path'] = app_config['static_path']
    if 'static_url_prefix' in app_config:
        config.app['static_url_prefix'] = app_config['static_url_prefix']
    if 'type' in app_config:
        config.app['type'] = app_config['type']
    if 'types' in app_config:
        for app_type in app_config['types']:
            app_type['launcher'] = get_config_from_package(
                app_type['launcher'])
            config.app['types'][app_type['name']] = app_type
    if 'wait_before_shutdown' in app_config:
        config.app['wait_before_shutdown'] = app_config['wait_before_shutdown']