diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-16 18:31:19 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-17 08:26:26 +0000 |
commit | b2a91466511f60e33e2e77fed2bf9c60bc31803d (patch) | |
tree | a34e90c980bf95d96c5db60a822e8954edf5c150 /src/buildstream/_options/optionflags.py | |
parent | a7ac4fed521881f54b76b199233c5aee3ba1f1ce (diff) | |
download | buildstream-b2a91466511f60e33e2e77fed2bf9c60bc31803d.tar.gz |
node: Add 'get_str_list' on 'MappingNode'
`mapping.get_sequence(...).as_str_list()` is a very common
pattern seen both in plugins and the core. Adding a helper to reduce
the number of operations will make usage smoother
Diffstat (limited to 'src/buildstream/_options/optionflags.py')
-rw-r--r-- | src/buildstream/_options/optionflags.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildstream/_options/optionflags.py b/src/buildstream/_options/optionflags.py index 80dd1b55d..64149d28e 100644 --- a/src/buildstream/_options/optionflags.py +++ b/src/buildstream/_options/optionflags.py @@ -93,4 +93,4 @@ class OptionFlags(Option): def load_valid_values(self, node): # Allow the more descriptive error to raise when no values # exist rather than bailing out here (by specifying default_value) - return node.get_sequence('values', default=[]).as_str_list() + return node.get_str_list('values', default=[]) |