summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-13 19:18:04 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-07-09 16:55:53 +0100
commit6bca027554150b5895bec062b32ef7d1616836be (patch)
treefa26e80896cdd95fbf6cdcd67ec778c72820aa65
parent41c461d5ce2c2c59192930171f0b586a56ae728e (diff)
downloadbuildstream-6bca027554150b5895bec062b32ef7d1616836be.tar.gz
element: remove 'node_subst_list_element'
This method is unused and can be easily reimplemented with the new Node API by looping over nodes.
-rw-r--r--src/buildstream/element.py41
-rw-r--r--src/buildstream/plugin.py3
2 files changed, 1 insertions, 43 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index c2a748d47..73c63b71c 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -549,47 +549,6 @@ class Element(Plugin):
raise LoadError(e.reason, '{}: {}'.format(provenance, e), detail=e.detail) from e
return ret
- def node_subst_list_element(self, node, member_name, indices):
- """Fetch the value of a list element from a node member, substituting any variables
- in the loaded value with the element contextual variables.
-
- Args:
- node (dict): A dictionary loaded from YAML
- member_name (str): The name of the member to fetch
- indices (list of int): List of indices to search, in case of nested lists
-
- Returns:
- The value of the list element in *member_name* at the specified *indices*
-
- Raises:
- :class:`.LoadError`
-
- This is essentially the same as :func:`~buildstream.plugin.Plugin.node_get_list_element`
- except that it assumes the expected type is a string and will also perform variable
- substitutions.
-
- **Example:**
-
- .. code:: python
-
- # Fetch the list itself
- strings = self.node_get_member(node, list, 'strings')
-
- # Iterate over the list indices
- for i in range(len(strings)):
-
- # Fetch the strings in this list, substituting content
- # with our element's variables if needed
- string = self.node_subst_list_element(
- node, 'strings', [ i ])
- """
- value = self.node_get_list_element(node, str, member_name, indices)
- try:
- return self.__variables.subst(value)
- except LoadError as e:
- provenance = _yaml.node_get_provenance(node, key=member_name, indices=indices)
- raise LoadError(e.reason, '{}: {}'.format(provenance, e), detail=e.detail) from e
-
def compute_manifest(self, *, include=None, exclude=None, orphans=True):
"""Compute and return this element's selective manifest
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index 007db4930..787b414cf 100644
--- a/src/buildstream/plugin.py
+++ b/src/buildstream/plugin.py
@@ -294,8 +294,7 @@ class Plugin():
For Elements, when variable substitution is desirable, the
:func:`Element.node_subst_member() <buildstream.element.Element.node_subst_member>`
- and :func:`Element.node_subst_list_element() <buildstream.element.Element.node_subst_list_element>`
- methods can be used.
+ method can be used.
"""
raise ImplError("{tag} plugin '{kind}' does not implement configure()".format(
tag=self.__type_tag, kind=self.get_kind()))