diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-13 19:19:19 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:02 +0000 |
commit | eafcee4b97504f1bb65c8a62439a25e38d0e6137 (patch) | |
tree | 0aed4c9a2cdd9cea9ab4cc6d0f116d6fd9f302af /src/buildstream/plugin.py | |
parent | 7d503879aa298b3772904333727d807e1b03767f (diff) | |
download | buildstream-eafcee4b97504f1bb65c8a62439a25e38d0e6137.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.
Diffstat (limited to 'src/buildstream/plugin.py')
-rw-r--r-- | src/buildstream/plugin.py | 38 |
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 |