summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-13 19:19:19 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-28 12:22:15 +0100
commit476b32793c8eb16ffb0ce7ea3334edd70059a24e (patch)
tree1226da297d045efa477ce9bae7a6d469344e4f82
parent23a722f0d58cb32ad7e5c887d5823ae919dfd758 (diff)
downloadbuildstream-476b32793c8eb16ffb0ce7ea3334edd70059a24e.tar.gz
plugin: remove 'node_get_list_element'
The new yaml API is able of getting these access with the same error messages handling. Having this helper is therefore not useful anymore.
-rw-r--r--src/buildstream/plugin.py38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index 2cdad410f..9b18e35c5 100644
--- a/src/buildstream/plugin.py
+++ b/src/buildstream/plugin.py
@@ -281,8 +281,7 @@ class Plugin():
data and store it.
Plugins should use the :func:`Plugin.node_get_member() <buildstream.plugin.Plugin.node_get_member>`
- and :func:`Plugin.node_get_list_element() <buildstream.plugin.Plugin.node_get_list_element>`
- methods to fetch values from the passed `node`. This will ensure that a nice human readable error
+ method to fetch values from the passed `node`. This will ensure that a nice human readable error
message will be raised if the expected configuration is not found, indicating the filename,
line and column numbers.
@@ -529,41 +528,6 @@ class Plugin():
"""
_yaml.node_validate(node, valid_keys)
- def node_get_list_element(self, node, expected_type, member_name, indices):
- """Fetch the value of a list element from a node member, raising an error if the
- value is incorrectly typed.
-
- Args:
- node (dict): A dictionary loaded from YAML
- expected_type (type): The expected type of the node member
- 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`
-
- Note:
- Returned strings are stripped of leading and trailing whitespace
-
- **Example:**
-
- .. code:: python
-
- # Fetch the list itself
- things = self.node_get_member(node, list, 'things')
-
- # Iterate over the list indices
- for i in range(len(things)):
-
- # Fetch dict things
- thing = self.node_get_list_element(
- node, dict, 'things', [ i ])
- """
- return _yaml.node_get(node, expected_type, member_name, indices=indices)
-
def debug(self, brief, *, detail=None):
"""Print a debugging message