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-07-09 16:55:53 +0100
commit96e7f6d4548f3dbe26d740398527c3f982a400f6 (patch)
tree7c1cccbb388f04ea5b7c0aa2c81d082d9fcfc63a
parent6bca027554150b5895bec062b32ef7d1616836be (diff)
downloadbuildstream-96e7f6d4548f3dbe26d740398527c3f982a400f6.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 787b414cf..47b97441d 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