| 210 | self._write_cmd("A") |
| 211 | |
| 212 | def graph(self, **kargs): |
| 213 | # type: (Any) -> None |
| 214 | g = ['digraph "pipe" {', "\tnode [shape=rectangle];", ] |
| 215 | for p in self.active_pipes: |
| 216 | g.append('\t"%i" [label="%s"];' % (id(p), p.name)) |
| 217 | g.append("") |
| 218 | g.append("\tedge [color=blue, arrowhead=vee];") |
| 219 | for p in self.active_pipes: |
| 220 | for s in p.sinks: |
| 221 | g.append('\t"%i" -> "%i";' % (id(p), id(s))) |
| 222 | g.append("") |
| 223 | g.append("\tedge [color=purple, arrowhead=veevee];") |
| 224 | for p in self.active_pipes: |
| 225 | for hs in p.high_sinks: |
| 226 | g.append('\t"%i" -> "%i";' % (id(p), id(hs))) |
| 227 | g.append("") |
| 228 | g.append("\tedge [color=red, arrowhead=diamond];") |
| 229 | for p in self.active_pipes: |
| 230 | for ts in p.trigger_sinks: |
| 231 | g.append('\t"%i" -> "%i";' % (id(p), id(ts))) |
| 232 | g.append('}') |
| 233 | graph = "\n".join(g) |
| 234 | do_graph(graph, **kargs) |
| 235 | |
| 236 | |
| 237 | class _PipeMeta(type): |