summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-01 17:58:43 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-03 15:18:17 +0900
commit2a27b9c424a882b36b84e8f327dace6d0e734f39 (patch)
treed89295efbf2b117573d2551ab17afe9ebd4b7b41
parentb97a92b04324d2b021234c17f2e1f2a25dd32a51 (diff)
downloadbuildstream-2a27b9c424a882b36b84e8f327dace6d0e734f39.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
-rw-r--r--buildstream/source.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/buildstream/source.py b/buildstream/source.py
index 9f8f4ffdb..2793fbc26 100644
--- a/buildstream/source.py
+++ b/buildstream/source.py
@@ -380,8 +380,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*
"""