diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-09-01 17:58:43 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-09-02 18:33:39 +0900 |
commit | f8b06acc4d7cf307e1106140330ad545023d7e81 (patch) | |
tree | 0ad269e54c89548e0a3e7519e75b096780c5a488 /buildstream/source.py | |
parent | 6805a2ab7192c56fa5a6141d0ad150d5dda67040 (diff) | |
download | buildstream-f8b06acc4d7cf307e1106140330ad545023d7e81.tar.gz |
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
Diffstat (limited to 'buildstream/source.py')
-rw-r--r-- | buildstream/source.py | 11 |
1 files 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() <buildstream.source.SourceFetcher.fetch>` + method will be called on the returned fetchers one by one, + before consuming the next fetcher in the list. *Since: 1.2* """ |