| 6418 | print(line) |
| 6419 | |
| 6420 | def _print(self, prefix="", is_root=True): |
| 6421 | # pointers |
| 6422 | ptr_l = " ├L─ " |
| 6423 | ext_l = " │ " |
| 6424 | ptr_r = " └R─ " |
| 6425 | ext_r = " " |
| 6426 | |
| 6427 | if is_root: |
| 6428 | yield prefix + self._node_info() |
| 6429 | |
| 6430 | if self.left is not None and self.right is not None: |
| 6431 | yield prefix + ptr_l + self.left._node_info() |
| 6432 | if self.left.left is not None and self.left.right is not None: |
| 6433 | yield from self.left._print(prefix=prefix + ext_l, is_root=False) |
| 6434 | |
| 6435 | yield prefix + ptr_r + self.right._node_info() |
| 6436 | if self.right.left is not None and self.right.right is not None: |
| 6437 | yield from self.right._print(prefix=prefix + ext_r, is_root=False) |
| 6438 | |
| 6439 | def _node_info(self) -> str: |
| 6440 | if self.proc_id is not None: |