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
评论列表
文章目录