| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
- Also add a convenience method 'safe_del' catching the exception
when we don't care if the value was there or not.
|
|
|
|
| |
Also adaprt every part of the code calling it
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
- Add the 'as_int()' method on 'ScalarNode' to replace
'node_get(mapping, key, int)'
- Adapt all call sites to use the new API
|
|
|
|
|
|
|
|
|
|
|
| |
- 'as_bool()' casts a ScalarNode into a boolean, understanding both
'True' and 'False' as truthy-falsy values, as per node_get(type=bool)
behavior
- 'is_none()' allwos checking whether the scalar node contains a 'None'
value. Since 'None' cannot be used when working with booleans, we need
to have a way of checking for 'None' when we actually need the
information of whether the value is unset.
- Adapt all call places to use the new API
|
|
|
|
|
|
|
|
|
|
| |
- 'get_scalar()' allows retrieving a scalar node from a mapping.
- 'as_str()' casts a ScalarNode into a string (thus removing the node
information).
Both together, those replace 'node_get(mapping, key, type=str)' but
also allow retrieving the 'Node' itself, which will allow in the future
lazier provenance computation.
|
|
|
|
|
|
|
|
| |
This allows to get a mapping node from another 'MappingNode',
replacing 'node_get(my_mapping, key, type=dict)'
Also changes all places where 'node_get' was called like that by
the new API.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
Calls to `isinstance` can be particularily costly. Using type() is
much faster. The only known case where the `isinstance` was useful
is for dictionnaries where we would ask for a 'Mapping' instead.
Disallowing 'Mapping' for expected_type considerably speeds up the
calls to this functions.
Also add into NEWS
|
|
This was discussed in #1008.
Fixes #1009.
|