Returns the subtree as a string for debugging. Returns: str: a tree view of the task (and optionally its children)
(self, indent=0, recursive=True)
| 414 | # I will probably remove these methods at some point because I hate them |
| 415 | |
| 416 | def get_dump(self, indent=0, recursive=True): |
| 417 | """Returns the subtree as a string for debugging. |
| 418 | |
| 419 | Returns: |
| 420 | str: a tree view of the task (and optionally its children) |
| 421 | """ |
| 422 | dbg = (' ' * indent * 2) |
| 423 | dbg += '%s/' % self.id |
| 424 | dbg += '%s:' % self.thread_id |
| 425 | dbg += ' Task of %s' % self.task_spec.name |
| 426 | if self.task_spec.description: |
| 427 | dbg += ' (%s)' % self.task_spec.description |
| 428 | dbg += ' State: %s' % TaskState.get_name(self._state) |
| 429 | dbg += ' Children: %s' % len(self.children) |
| 430 | if recursive: |
| 431 | for child in self.children: |
| 432 | dbg += '\n' + child.get_dump(indent + 1) |
| 433 | return dbg |
| 434 | |
| 435 | def dump(self, indent=0): |
| 436 | """Prints the subtree as a string for debugging.""" |