blob: 12530cfb1ccf493d96d07828dcaa5ba4e95fc633 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
'''
Autodebugger output contains -1 for function entry and -2 for function exit.
This script will indent the output nicely
'''
import os, sys
lines = sys.stdin.read().split('\n')
depth = 0
for i in range(len(lines)):
line = lines[i]
if line.startswith('AD:-2,'):
depth -= 1
lines[i] = (' '*depth) + line
if line.startswith('AD:-1,'):
depth += 1
print '\n'.join(lines)
|