From f8b06acc4d7cf307e1106140330ad545023d7e81 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sat, 1 Sep 2018 17:58:43 +0900 Subject: source.py: Document Source.get_source_fetchers() to return an iterable Also highlight the fact that the plugin can rely on the fetcher's fetch() method getting called before consuming the next item in the list, which is the magick behavior that the git plugin relies on. This is a part of #620 --- buildstream/source.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/buildstream/source.py b/buildstream/source.py index b86f3fb16..f806546fb 100644 --- a/buildstream/source.py +++ b/buildstream/source.py @@ -453,8 +453,15 @@ class Source(Plugin): is recommended. Returns: - list: A list of SourceFetchers. If SourceFetchers are not supported, - this will be an empty list. + iterable: The Source's SourceFetchers, if any. + + .. note:: + + Implementors can implement this as a generator. + + The :func:`SourceFetcher.fetch() ` + method will be called on the returned fetchers one by one, + before consuming the next fetcher in the list. *Since: 1.2* """ -- cgit v1.2.1