예제 #1
0
 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)
예제 #2
0
def _check_duplicates(value: HasUniqueID, src: Mapping[str, HasUniqueID]):
    if value.unique_id in src:
        raise_duplicate_resource_name(value, src[value.unique_id])
예제 #3
0
 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
예제 #4
0
 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