Start configuration process for the provided handler

        Args:
            cfg (dict): config container
            handler (config.Handler class): config handler to use
            path (str): current path in the configuration progress
186957
def configure(self, cfg, handler, path=""):

        

        # configure simple value attributes (str, int etc.)
        for name, attr in handler.attributes():
            if cfg.get(name) is not None:
                continue
            if attr.expected_type not in [list, dict]:
                cfg[name] = self.set(handler, attr, name, path, cfg)
            elif attr.default is None and not hasattr(handler, "configure_%s" % name):
                self.action_required.append(("%s.%s: %s" % (path, name, attr.help_text)).strip("."))

        # configure attributes that have complex handlers defined
        # on the config Handler class (class methods prefixed by
        # configure_ prefix
        for name, attr in handler.attributes():
            if cfg.get(name) is not None:
                continue
            if hasattr(handler, "configure_%s" % name):
                fn = getattr(handler, "configure_%s" % name)
                fn(self, cfg, "%s.%s"% (path, name))
                if attr.expected_type in [list, dict] and not cfg.get(name):
                    try:
                        del cfg[name]
                    except KeyError:
                        pass
14994
def load_configuration(conf_path):
    
    with open(conf_path) as f:
        conf_dict = yaml.load(f)
    validate_config(conf_dict)
    return conf_dict
616756
def main(args=None):
    
    cfg.configureLogger()
    wireHandlers(cfg)
    # get config from a flask standard place not our config yml
    app.run(debug=cfg.runInDebug(), host='0.0.0.0', port=cfg.getPort())
914398
def configure(options, cfg)
      cfg = super(options, cfg)
      cfg[:offline_queueing] = options[:offline_queueing]
      cfg[:filter_params] = options[:filter_params]
      cfg
    end
1036050
def start(self):
             
        self.parse_opt()
        self.parse_cfg()

        # if -b, -B or -p option is set, only show information, don't
        # start the experiments
        if self.options.browse or self.options.browse_big or self.options.progress:
            self.browse()
            raise SystemExit
        
        # read main configuration file
        paramlist = []
        for exp in self.cfgparser.sections():
            if not self.options.experiments or exp in self.options.experiments:
                params = self.items_to_params(self.cfgparser.items(exp))
                params['name'] = exp
                paramlist.append(params)
                
        self.do_experiment(paramlist)
492815
def start(name, config_file=None):
    '''
    
    '''
    if not exists(name):
        raise ContainerNotExists("The container (%s) does not exist!" % name)
    if name in running():
        raise ContainerAlreadyRunning('The container %s is already started!' % name)
    cmd = ['lxc-start', '-n', name, '-d']
    if config_file:
        cmd += ['-f', config_file]
    subprocess.check_call(cmd)
46053
def configure(conf, default_config=None):
    
    if conf.logconfig and os.path.isfile(conf.logconfig):
        logging.config.fileConfig(conf.logconfig,
                                  disable_existing_loggers=False)
    elif default_config and os.path.isfile(default_config):
        logging.config.fileConfig(default_config,
                                  disable_existing_loggers=False)
    else:
        init_console_logging(conf)
430064
def write_config_file(self, params, path):
        
        cfgp = ConfigParser()
        cfgp.add_section(params['name'])
        for p in params:
            if p == 'name':
                continue
            cfgp.set(params['name'], p, params[p])
        f = open(os.path.join(path, 'experiment.cfg'), 'w')
        cfgp.write(f)
        f.close()
823364
def load_settings(cfg_path=None):
    

    global settings

    cfg_path = cfg_path or _config['cfg_path']

    cfg_d = _config.copy()

    if os.path.exists(cfg_path):
        sfl = SourceFileLoader('upkg_cfg', cfg_path)
        cfg_mod = sfl.load_module()

        for m in inspect.getmembers(cfg_mod):
            if m[0][0] != '_':
                cfg_d[m[0]] = m[1]
        # end for m in inspect.getme

    # Make the paths absolute.
    cfg_d["cfg_path"] = _clean_path(cfg_d["cfg_path"])
    cfg_d["upkg_destdir"] = _clean_path(cfg_d["upkg_destdir"])

    settings = Namespace(**cfg_d)
488178
def start(self):
        
        component = Component(self.config, self.handlers)
        component.run()
85215
def config_start(args):
    ''''''

    # Try to use call caching (job avoidance)?  Flexibly accept range of answers
    cache = getattr(args, "cache", True)
    cache = cache is True or (cache.lower() in ["y", "true", "yes", "t", "1"])

    if not args.namespace:
        args.namespace = fcconfig.method_ns
    if not args.namespace:
        raise RuntimeError("namespace not provided, or configured by default")

    r = fapi.create_submission(args.project, args.workspace,args.namespace,
                            args.config, args.entity, args.entity_type,
                            args.expression, use_callcache=cache)
    fapi._check_response_code(r, 201)
    id = r.json()['submissionId']

    return ("Started {0}/{1} in {2}/{3}: id={4}".format(
        args.namespace, args.config, args.project, args.workspace, id)), id
1352884
def _read_config(cfg_file):
    
    config = ConfigParser()
    # maintain case of options
    config.optionxform = lambda option: option
    if not os.path.exists(cfg_file):
        # Create an empty config
        config.add_section(_MAIN_SECTION_NAME)
        config.add_section(_ENVIRONMENT_SECTION_NAME)
    else:
        config.read(cfg_file)
    return config
232092
def modify_config(path):
    
    if isinstance(path, str):
        path = Path(path)
    config = _read_pkg_ini(path)
    _validate_config(config, path)

    # don't catch exception, we won't write the new config.
    yield config

    _validate_config(config, path)
    with path.open('w') as f:
        config.write(f)
734120
def init_log_config(handler=None):
    
    for applog in lognames.values():
        # propagate except for root app logger 'linkcheck'
        propagate = (applog != LOG_ROOT)
        configdict['loggers'][applog] = dict(level='INFO', propagate=propagate)

    logging.config.dictConfig(configdict)
    if handler is None:
        handler = ansicolor.ColoredStreamHandler(strm=sys.stderr)
    add_loghandler(handler)
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
393879
def load_config_from_cli_arguments(self, *args, **kwargs):
        
        self._load_config_from_cli_argument(key='handlers_package', **kwargs)
        self._load_config_from_cli_argument(key='auth', **kwargs)
        self._load_config_from_cli_argument(key='user_stream', **kwargs)
        self._load_config_from_cli_argument(key='min_seconds_between_errors', **kwargs)
        self._load_config_from_cli_argument(key='sleep_seconds_on_consecutive_errors', **kwargs)
908630
def start():
    """"""

    setupdir = dirname(dirname(__file__))
    curdir = os.getcwd()

    # First look on the command line for a desired config file,
    # if it's not on the command line, then look for 'setup.py'
    # in the current directory. If there, load configuration
    # from a file called 'dev.cfg'. If it's not there, the project
    # is probably installed and we'll look first for a file called
    # 'prod.cfg' in the current directory and then for a default
    # config file called 'default.cfg' packaged in the egg.
    if len(sys.argv) > 1:
        configfile = sys.argv[1]
    elif exists(join(setupdir, "setup.py")):
        configfile = join(setupdir, "dev.cfg")
    elif exists(join(curdir, "prod.cfg")):
        configfile = join(curdir, "prod.cfg")
    else:
        try:
            configfile = pkg_resources.resource_filename(
              pkg_resources.Requirement.parse("tgpisa"),
                "config/default.cfg")
        except pkg_resources.DistributionNotFound:
            raise ConfigurationError("Could not find default configuration.")

    turbogears.update_config(configfile=configfile,
        modulename="tgpisa.config")

    from tgpisa.controllers import Root

    turbogears.start_server(Root())