summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-07 10:16:49 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-07 10:16:49 +0100
commit5ed171061e554101035c8ec97784f017b7e5516a (patch)
tree7d05153700160d86fb61efd973ad09936b368293
parenta39460eba0f74811a11a8dc3652bfcd21d38a64f (diff)
downloadbuildstream-5ed171061e554101035c8ec97784f017b7e5516a.tar.gz
NEWS: restrict `Plugin.node_items` to be called on `Node`s.
Also update documentation in plugin for APIs that do accept Node and not `dict`.
-rw-r--r--NEWS3
-rw-r--r--src/buildstream/plugin.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index c37ad1b6a..3e715187b 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@
buildstream 1.3.1
=================
+ o BREAKING CHANGE: `Plugin.node_items` doesn't accept 'dict' values anymore.
+ Please used `Node`s instead.
+
o BREAKING CHANGE: `node_get_member` doesn't accept 'expected_type=Mapping'
anymore. Please use 'expected_type=dict' instead.
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index d8b6a7359..a12ff61ec 100644
--- a/src/buildstream/plugin.py
+++ b/src/buildstream/plugin.py
@@ -358,7 +358,7 @@ class Plugin():
"""Iterate over a dictionary loaded from YAML
Args:
- node (dict): The YAML loaded dictionary object
+ node (Node): The YAML loaded dictionary object
Returns:
list: List of key/value tuples to iterate over
@@ -378,7 +378,7 @@ class Plugin():
for reporting an error or warning.
Args:
- node (dict): The YAML loaded dictionary object
+ node (Node): The YAML loaded dictionary object
member_name (str): The name of the member to check, or None for the node itself
Returns:
@@ -392,7 +392,7 @@ class Plugin():
missing or incorrectly typed.
Args:
- node (dict): A dictionary loaded from YAML
+ node (Node): 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
default (expected_type): A value to return when *member_name* is not specified in *node*