summaryrefslogtreecommitdiff
path: root/src/buildstream/plugin.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-25 21:14:40 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-27 15:08:11 +0100
commit4e66ca802766545084018441b2a2ddda81c34f2f (patch)
tree6b1c532cb502a78ca769d73c71ddbf724dad3d08 /src/buildstream/plugin.py
parent4652bfa0cbd86bdf24dae416b75c2607e5edcd41 (diff)
downloadbuildstream-bschubert/node-api-keys.tar.gz
_yaml: Remove 'node_items' and add 'MappingNode.items()'bschubert/node-api-keys
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.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index f2bd90b35..400b6802a 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)