Loading buildstream/_context.py +2 −2 Original line number Diff line number Diff line Loading @@ -202,11 +202,11 @@ class Context(): _yaml.composite(defaults, user_config) # Give obsoletion warnings if _yaml.node_contains(defaults, 'builddir'): if 'builddir' in defaults: raise LoadError(LoadErrorReason.INVALID_DATA, "builddir is obsolete, use cachedir") if _yaml.node_contains(defaults, 'artifactdir'): if 'artifactdir' in defaults: raise LoadError(LoadErrorReason.INVALID_DATA, "artifactdir is obsolete") Loading buildstream/_gitsourcebase.py +1 −1 Original line number Diff line number Diff line Loading @@ -423,7 +423,7 @@ class _GitSourceBase(Source): self.mark_download_url(url, primary=False) self.submodule_overrides[path] = url if self.node_has_member(submodule, 'checkout'): if 'checkout' in submodule: checkout = self.node_get_member(submodule, bool, 'checkout') self.submodule_checkout_overrides[path] = checkout Loading buildstream/_project.py +2 −2 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ class Project(): else: config = self.config if not alias or not _yaml.node_contains(config._aliases, alias): if not alias or alias not in config._aliases: return [None] mirror_list = [] Loading Loading @@ -950,7 +950,7 @@ class Project(): plugins = _yaml.node_get(origin, Mapping, plugin_group, default_value={}) _yaml.node_set(origin_node, 'plugins', [k for k in _yaml.node_keys(plugins)]) for group in expected_groups: if _yaml.node_contains(origin_node, group): if group in origin_node: _yaml.node_del(origin_node, group) if _yaml.node_get(origin_node, str, 'origin') == 'local': Loading buildstream/_projectrefs.py +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ class ProjectRefs(): # Ensure we create our toplevel entry point on the fly here for node in [self._toplevel_node, self._toplevel_save]: if not _yaml.node_contains(node, 'projects'): if 'projects' not in node: _yaml.node_set(node, 'projects', _yaml.new_empty_node(ref_node=node)) # lookup_ref() Loading buildstream/_yaml.py +4 −16 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ from ._exceptions import LoadError, LoadErrorReason # class Node(namedtuple('Node', ['value', 'file_index', 'line', 'column'])): def __contains__(self, what): assert False, \ "BUG: Attempt to do `{} in {}` test".format(what, self) # Delegate to the inner value, though this will likely not work # very well if the node is a list or string, it's unlikely that # code which has access to such nodes would do this. return what in self[0] # File name handling Loading Loading @@ -772,20 +774,6 @@ def __new_node_from_list(inlist): return Node(ret, None, 0, next(_SYNTHETIC_COUNTER)) # node_contains() # # Args: # node (Node): The mapping node to query the contents of # entry (str): The key to look for in the mapping node # # Returns: # (bool): Whether entry is in the mapping in node. # def node_contains(node, entry): assert type(node) is Node return entry in node[0] # _is_composite_list # # Checks if the given node is a Mapping with array composition Loading Loading
buildstream/_context.py +2 −2 Original line number Diff line number Diff line Loading @@ -202,11 +202,11 @@ class Context(): _yaml.composite(defaults, user_config) # Give obsoletion warnings if _yaml.node_contains(defaults, 'builddir'): if 'builddir' in defaults: raise LoadError(LoadErrorReason.INVALID_DATA, "builddir is obsolete, use cachedir") if _yaml.node_contains(defaults, 'artifactdir'): if 'artifactdir' in defaults: raise LoadError(LoadErrorReason.INVALID_DATA, "artifactdir is obsolete") Loading
buildstream/_gitsourcebase.py +1 −1 Original line number Diff line number Diff line Loading @@ -423,7 +423,7 @@ class _GitSourceBase(Source): self.mark_download_url(url, primary=False) self.submodule_overrides[path] = url if self.node_has_member(submodule, 'checkout'): if 'checkout' in submodule: checkout = self.node_get_member(submodule, bool, 'checkout') self.submodule_checkout_overrides[path] = checkout Loading
buildstream/_project.py +2 −2 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ class Project(): else: config = self.config if not alias or not _yaml.node_contains(config._aliases, alias): if not alias or alias not in config._aliases: return [None] mirror_list = [] Loading Loading @@ -950,7 +950,7 @@ class Project(): plugins = _yaml.node_get(origin, Mapping, plugin_group, default_value={}) _yaml.node_set(origin_node, 'plugins', [k for k in _yaml.node_keys(plugins)]) for group in expected_groups: if _yaml.node_contains(origin_node, group): if group in origin_node: _yaml.node_del(origin_node, group) if _yaml.node_get(origin_node, str, 'origin') == 'local': Loading
buildstream/_projectrefs.py +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ class ProjectRefs(): # Ensure we create our toplevel entry point on the fly here for node in [self._toplevel_node, self._toplevel_save]: if not _yaml.node_contains(node, 'projects'): if 'projects' not in node: _yaml.node_set(node, 'projects', _yaml.new_empty_node(ref_node=node)) # lookup_ref() Loading
buildstream/_yaml.py +4 −16 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ from ._exceptions import LoadError, LoadErrorReason # class Node(namedtuple('Node', ['value', 'file_index', 'line', 'column'])): def __contains__(self, what): assert False, \ "BUG: Attempt to do `{} in {}` test".format(what, self) # Delegate to the inner value, though this will likely not work # very well if the node is a list or string, it's unlikely that # code which has access to such nodes would do this. return what in self[0] # File name handling Loading Loading @@ -772,20 +774,6 @@ def __new_node_from_list(inlist): return Node(ret, None, 0, next(_SYNTHETIC_COUNTER)) # node_contains() # # Args: # node (Node): The mapping node to query the contents of # entry (str): The key to look for in the mapping node # # Returns: # (bool): Whether entry is in the mapping in node. # def node_contains(node, entry): assert type(node) is Node return entry in node[0] # _is_composite_list # # Checks if the given node is a Mapping with array composition Loading