def from_streams(cls, *, streams, **kwargs):
documents = []
for stream in streams:
stream_name = getattr(stream, 'name')
if stream_name is not None:
LOG.info('Loading documents from %s', stream_name)
stream_documents = list(yaml.safe_load_all(stream))
validation.check_schemas(stream_documents)
if stream_name is not None:
LOG.info('Successfully validated documents from %s',
stream_name)
documents.extend(stream_documents)
return cls(documents=documents, **kwargs)
评论列表
文章目录