| 233 | stream.append(node.requires) |
| 234 | |
| 235 | def _finalize_steps(self, steps): |
| 236 | last = self._find_last() |
| 237 | self._firstpass(steps) |
| 238 | it = ((C, C.requires) for C in steps.values()) |
| 239 | G = self.graph = DependencyGraph( |
| 240 | it, formatter=self.GraphFormatter(root=last), |
| 241 | ) |
| 242 | if last: |
| 243 | for obj in G: |
| 244 | if obj != last: |
| 245 | G.add_edge(last, obj) |
| 246 | try: |
| 247 | return G.topsort() |
| 248 | except KeyError as exc: |
| 249 | raise KeyError('unknown bootstep: %s' % exc) |
| 250 | |
| 251 | def claim_steps(self): |
| 252 | return dict(self.load_step(step) for step in self.types) |