Load ``conf.py`` from given ``srcdir``.

    :returns: Dictionary derived from the conf module.
495585
def load_conf(srcdir):
    
    path = os.path.join(srcdir, 'conf.py')
    mylocals = {'__file__': path}
    with open(path) as fd:
        exec(fd.read(), mylocals)
    return mylocals
1217397
def load_configuration(configuration):
    """"""
    if isinstance(configuration, dict):
        return configuration
    else:
        with open(configuration) as configfile:
            return json.load(configfile)
8258
def from_pyfile(self, filename: str) -> None:
        """"""
        globals_ = {}  # type: Dict[str, Any]
        locals_ = {}  # type: Dict[str, Any]
        with open(filename, "rb") as f:
            exec(compile(f.read(), filename, 'exec'), globals_, locals_)

        for key, value in locals_.items():
            if (key.isupper() and not isinstance(value, types.ModuleType)):
                self._setattr(key, value)

        logger.info("Config is loaded from file: %s", filename)
130720
def _load_defaults(self, default='settings.py'):
        '''
        
        '''
        if default[-3:] == '.py':
            default = default[:-3]

        self.my_settings = {}
        try:
            settings = importlib.import_module(default)
            self.my_settings = self._convert_to_dict(settings)
        except ImportError:
            log.warning("No default settings found")
467961
def load_conf(cfg_path):
    
    global config
    try:
        cfg = open(cfg_path, 'r')
    except Exception as ex:
        if verbose:
            print("Unable to open {0}".format(cfg_path))
            print(str(ex))
        return False

    # Read the entire contents of the conf file
    cfg_json = cfg.read()
    cfg.close()
    # print(cfg_json)

    # Try to parse the conf file into a Python structure
    try:
        config = json.loads(cfg_json)
    except Exception as ex:
        print("Unable to parse configuration file as JSON")
        print(str(ex))
        return False

    # This config was successfully loaded
    return True
290676
def _load_from_configs(self, filename):
    
    config_filename = os.path.join(self._config_path, filename)
    if os.path.exists(config_filename):
      try:
        f = open(config_filename, 'r')
        content = ''.join(f.readlines())
        f.close()
        return content
      except Exception as err:
        raise err
    else:
      raise IOError("File not found: {}".format(config_filename))
333409
def fromdict(self, src_dict, method='set'):
        
        if method == 'set':
            _method = self.set_method
        else:
            _method = self.add_method
        if hasattr(src_dict, 'iteritems'):
            for (key, val) in src_dict.iteritems():
                _method(self, key, len(key), val)
                if self.k:
                    self._update(key, val)
        else:
            for (key, val) in src_dict.items():
                _method(self, key, len(key), val)
                if self.k:
                    self._update(key, val)
300706
def dict_load(self, ns_dict):
        
        for prefix, uri in ns_dict.items():
            self.bind(prefix, uri, override=False, calc=False)
        self.__make_dicts__
16282
def from_dict(cls, d):
        
        conf = {}
        for k in d["config"]:
            v = d["config"][k]
            if isinstance(v, dict):
                conf[str(k)] = get_dict_handler(d["config"]["type"])(v)
            else:
                conf[str(k)] = v
        return get_class(str(d["class"]))(config=conf)
830620
def from_module_dict(cls, environment, module_dict, globals):
        
        return cls._from_namespace(environment, module_dict, globals)
1243533
def load_config(conf_dir=DEFAULT_CONFIG_DIR, schema=CLIENT_SCHEMA):
    
    data = default_config(schema)
    config = read_config(conf_dir)
    if config:
        recursive_update(data, config)
    return data
14994
def load_configuration(conf_path):
    
    with open(conf_path) as f:
        conf_dict = yaml.load(f)
    validate_config(conf_dict)
    return conf_dict
361362
def load_dict(self, dct):
        """"""
        for k, v in dct.items():
            setattr(self, k, v)
157006
def load_config(cls, configfile="logging.yaml"):
        
        configfile = getenv(cls.CONFIGFILE_ENV_KEY, configfile)
        if isfile(configfile):
            with open(configfile, "r") as cf:
                # noinspection PyBroadException
                try:
                    dictConfig(load(cf))
                except ValueError:
                    debug("Learn to config foooo! Improper config at %s", configfile)
                except Exception:
                    exception("Something went wrong while reading %s.", configfile)
        else:
            raise ValueError("Invalid configfile specified: {}".format(configfile))
703407
def _parse_conf(conf_file=default_conf):
    '''
    
    '''
    ret = {}
    with salt.utils.files.fopen(conf_file, 'r') as ifile:
        for line in ifile:
            line = salt.utils.stringutils.to_unicode(line).strip()
            if not line:
                continue
            if line.startswith('#'):
                continue
            splitline = line.split(' ', 1)
            ret[splitline[0]] = splitline[1]
    return ret
106711
def load_config(filename):
    '''
    
    '''
    try:
        with open(filename, 'r') as config_file:
            return json.loads(config_file.read())
    except IOError:
        pass
334706
def load_contrib(name, globals_dict=None, symb_list=None):
    
    try:
        importlib.import_module("scapy.contrib." + name)
        _load("scapy.contrib." + name,
              globals_dict=globals_dict, symb_list=symb_list)
    except ImportError as e:
        # if layer not found in contrib, try in layers
        try:
            load_layer(name,
                       globals_dict=globals_dict, symb_list=symb_list)
        except ImportError:
            raise e