diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-06-25 21:14:40 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4 (patch) | |
tree | 8e675fc215ab9f1fcf8851470c95c0e2039f42ee /src/buildstream/plugin.py | |
parent | 42d3d8406a15cd5f6f4a7d00e298dba019a50ed6 (diff) | |
download | buildstream-1aa0fb1fefa7e86586831a13200a92f6dd9bd3b4.tar.gz |
_yaml: Remove 'node_items' and add 'MappingNode.items()'
One difference is that 'MappingNode.items()' does not strip the
provenance from scalars and lists, which ends up not affecting the
code much.
Diffstat (limited to 'src/buildstream/plugin.py')
-rw-r--r-- | src/buildstream/plugin.py | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py index b2050e219..37b9c3401 100644 --- a/src/buildstream/plugin.py +++ b/src/buildstream/plugin.py @@ -347,23 +347,6 @@ class Plugin(): """ return self.__kind - def node_items(self, node): - """Iterate over a dictionary loaded from YAML - - Args: - node (Node): The YAML loaded dictionary object - - Returns: - list: List of key/value tuples to iterate over - - BuildStream holds some private data in dictionaries loaded from - the YAML in order to preserve information to report in errors. - - This convenience function should be used instead of the dict.items() - builtin function provided by python. - """ - yield from _yaml.node_items(node) - def node_provenance(self, node, member_name=None): """Gets the provenance for `node` and `member_name` @@ -819,10 +802,10 @@ class Plugin(): silenced_warnings = set() project = self.__project - for key, value in self.node_items(project.element_overrides): + for key, value in project.element_overrides.items(): if value.get_bool('suppress-deprecation-warnings', default=False): silenced_warnings.add(key) - for key, value in self.node_items(project.source_overrides): + for key, value in project.source_overrides.items(): if value.get_bool('suppress-deprecation-warnings', default=False): silenced_warnings.add(key) |