config.py 文件源码

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

项目:ingest-client 作者: jhuapl-boss 项目源码 文件源码
def load(self, config_data):
        """
        Method to load the configuration file, the configuration schema, and select the correct validator and backend

        Args:
            config_data(dict): The configuration dictionary

        Returns:
            None

        """
        self.config_data = config_data

        # Load the schema file based on the config that was provided
        try:
            schema_name = self.config_data['schema']['name']
        except KeyError as err:
            raise ConfigFileError("The specified schema was not found: {}. Try to update your ingest client library or double check your ingest job configuration file".format(self.config_data['schema']['name']))
        with open(os.path.join(resource_filename("ingestclient", "schema"), "{}.json".format(schema_name)), 'rt') as schema_file:
            self.schema = json.load(schema_file)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号