summaryrefslogtreecommitdiff
path: root/src/buildstream/_includes.py
Commit message (Collapse)AuthorAgeFilesLines
* _exceptions.py: Align LoadError() parameter orderingtpollard/loaderrorTom Pollard2019-07-181-5/+4
| | | | | | All of the errors which subclass from BstError have their first positional argument as message, LoadError should follow this ordering for consistency.
* node: Rename 'copy' to 'clone'Benjamin Schubert2019-07-151-1/+1
| | | | | | | | A 'clone' operation has an implicit understanding that it is expensive, which is not the case of a 'copy' operation, which is more usually a shallow copy. Therefore renaming to 'clone'
* _yaml: Split Node-related parts into 'node.pyx'Benjamin Schubert2019-07-151-4/+5
| | | | | This makes the 'Node' API public, and available for use directly for plugins.
* _yaml: Set 'MappingNode' public-private APIBenjamin Schubert2019-07-151-1/+1
| | | | | | | - _composite -> __composite (internal) - composite -> _composite (BuildStream private) - composite_under -> _composite_under (BuildStream private) - get -> _get (internal)
* _yaml: Remove 'node_get_provenance' and add 'Node.get_provenance'Benjamin Schubert2019-07-151-1/+2
| | | | | | | | This replaces the helper method by adding a 'get_provenance' on the node directly - Adapt all call sites - Delay getting provenance wherever possible without major refactor
* _yaml: Move 'node_composite' to a method on 'MappingNode'Benjamin Schubert2019-07-151-1/+1
| | | | | - Also take care of node_composite_move in the same way. - Adapt all calling places
* _yaml: Introduce 'MappingNode.values()'Benjamin Schubert2019-07-151-3/+5
| | | | | | | This is to mimic the 'dict.values()' interface. - Adapt parts of the code calling 'node_items' but ignoring the first value to use this instead
* _yaml: Remove 'node_del' and support `del mapping[key]`Benjamin Schubert2019-07-151-1/+1
| | | | | - Also add a convenience method 'safe_del' catching the exception when we don't care if the value was there or not.
* _yaml: Remove 'node_copy' and add 'Node.copy()'Benjamin Schubert2019-07-151-1/+1
| | | | Also adaprt every part of the code calling it
* _yaml: Add a 'get_node' on Mapping, when return type can be of multiple typesBenjamin Schubert2019-07-151-12/+7
| | | | | | | | | | | Sometimes, we might want to have a list or a string, in which case, we can now use 'get_node', which can return multiple types. This method doesn't contain a 'default' value, as building a 'Node' from it would be hard. We therefore just have a 'allow_none' flag that allows returning 'None' when the value is not found. - includes: use the new 'get_node' instead of trying multiple versions
* _yaml: Introduce 'get_sequence()' and 'sequence_at()'/'mapping_at()'Benjamin Schubert2019-07-151-1/+1
| | | | | | | | | - Adding 'get_sequence' on MappingNode to access sequences in a mapping - Adding 'sequence_at' on SequenceNode to access sequences in a sequence - Adding 'mapping_at' on SequenceNode to access mappings in a sequence Using "*_at" in sequences allows us to quickly understand if we are dealing with a sequence or a mapping.
* _yaml: Remove use of expected_type=None in 'node_get()'Benjamin Schubert2019-07-151-9/+11
| | | | | | | In a strongly typed API with Node, having a 'None' as expected type is hard to make nice. Moreover, this is rarely used in the codebase. Thus, adapting the call sites to not use 'None' as an expected type.
* Always fetch subprojects as neededJürg Billeter2019-06-251-1/+1
| | | | | | Treat junction element sources the same as sources of any other element and always fetch subprojects as needed. Do not ask the user to manually fetch subprojects.
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-0/+145
This was discussed in #1008. Fixes #1009.