def add_nodes(self, new_nodes: Mapping[str, ManifestNode]): """Add the given dict of new nodes to the manifest.""" for unique_id, node in new_nodes.items(): if unique_id in self.nodes: raise_duplicate_resource_name(node, self.nodes[unique_id]) self.nodes[unique_id] = node # fixup the cache if it exists. if self._refs_cache is not None: if node.resource_type in NodeType.refable(): self._refs_cache.add_node(node)
def _check_duplicates(value: HasUniqueID, src: Mapping[str, HasUniqueID]): if value.unique_id in src: raise_duplicate_resource_name(value, src[value.unique_id])
def add_nodes(self, new_nodes): """Add the given dict of new nodes to the manifest.""" for unique_id, node in new_nodes.items(): if unique_id in self.nodes: raise_duplicate_resource_name(node, self.nodes[unique_id]) self.nodes[unique_id] = node