loader.py 文件源码

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

项目:wargame 作者: maximinus 项目源码 文件源码
def load(self, root_folder):
        # config files under ROOT/resources/config
        # iterate through those files
        for subdir, dirs, files in os.walk(root_folder):
            for file in files:
                # load this yaml file
                filepath = os.path.join(subdir, file)
                data = yaml.load(open(filepath, 'r'))
                path = PurePath(filepath).parts
                path = '/'.join(path[path.index('resources'):])
                config = get_config_item(data, path)
                if config is None:
                    logger.error('Failed to load {0}'.format(path))
                    continue
                # store this item
                self.data[config.data.type] = config.data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号