Appends a Node or Edge to the graph: Graph.append(Node, id="rabbit").
(self, base, *args, **kwargs)
| 337 | raise KeyError, "no node with id '%s' in graph" % id |
| 338 | |
| 339 | def append(self, base, *args, **kwargs): |
| 340 | """ Appends a Node or Edge to the graph: Graph.append(Node, id="rabbit"). |
| 341 | """ |
| 342 | kwargs["base"] = base |
| 343 | if issubclass(base, Node): |
| 344 | return self.add_node(*args, **kwargs) |
| 345 | if issubclass(base, Edge): |
| 346 | return self.add_edge(*args, **kwargs) |
| 347 | |
| 348 | def add_node(self, id, *args, **kwargs): |
| 349 | """ Appends a new Node to the graph. |