config_util.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:indy-plenum 作者: hyperledger 项目源码 文件源码
def getInstalledConfig(installDir, configFile):
    """
    Reads config from the installation directory of Plenum.

    :param installDir: installation directory of Plenum
    :param configFile: name of the configuration file
    :raises: FileNotFoundError
    :return: the configuration as a python object
    """
    configPath = os.path.join(installDir, configFile)
    if not os.path.exists(configPath):
        raise FileNotFoundError("No file found at location {}".
                                format(configPath))
    spec = spec_from_file_location(configFile, configPath)
    config = module_from_spec(spec)
    spec.loader.exec_module(config)
    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号