(root, indent="", transform=View.__str__, stream=sys.stdout)
| 3457 | |
| 3458 | @staticmethod |
| 3459 | def __traverse(root, indent="", transform=View.__str__, stream=sys.stdout): |
| 3460 | if not root: |
| 3461 | return |
| 3462 | |
| 3463 | s = transform(root) |
| 3464 | if stream and s: |
| 3465 | if type(root) == WindowHierarchy: |
| 3466 | if transform == View.__str__: |
| 3467 | print(s, file=stream) |
| 3468 | return |
| 3469 | else: |
| 3470 | if sys.version_info[0] < 3: |
| 3471 | ius = "%s%s" % (indent, s if isinstance(s, unicode) else unicode(s, 'utf-8', 'replace')) |
| 3472 | else: |
| 3473 | ius = "%s%s" % (indent, s if isinstance(s, str) else str(s, 'utf-8', 'replace')) |
| 3474 | print(ius.encode('utf-8', 'replace').decode('utf-8'), file=stream) |
| 3475 | |
| 3476 | for ch in root.children: |
| 3477 | ViewClient.__traverse(ch, indent=indent + " ", transform=transform, stream=stream) |
| 3478 | |
| 3479 | def dump(self, window=-1, sleep=1): |
| 3480 | """ |
no outgoing calls
no test coverage detected