OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
3 # Copyright 2008 Google Inc. All Rights Reserved. | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
4 | 5 |
5 """Process a History database and dump a .dot file suitable for GraphViz. | 6 """Process a History database and dump a .dot file suitable for GraphViz. |
6 | 7 |
7 This is useful for debugging history redirect flows. | 8 This is useful for debugging history redirect flows. |
8 | 9 |
9 An example run of this program: | 10 An example run of this program: |
10 python /src/history-viz.py History > foo.dot | 11 python /src/history-viz.py History > foo.dot |
11 /c/Program\ Files/Graphviz2.18/bin/dot -Tpng foo.dot -o foo.png | 12 /c/Program\ Files/Graphviz2.18/bin/dot -Tpng foo.dot -o foo.png |
12 """ | 13 """ |
13 | 14 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 edgeattrs.append('style=dashed') | 232 edgeattrs.append('style=dashed') |
232 if len(label) > 0: | 233 if len(label) > 0: |
233 edgeattrs.append('label="%s"' % EscapeDot('\n'.join(label))) | 234 edgeattrs.append('label="%s"' % EscapeDot('\n'.join(label))) |
234 | 235 |
235 out = '%s -> %s' % (src, dst) | 236 out = '%s -> %s' % (src, dst) |
236 if len(edgeattrs) > 0: | 237 if len(edgeattrs) > 0: |
237 out += ' [%s]' % ','.join(edgeattrs) | 238 out += ' [%s]' % ','.join(edgeattrs) |
238 print out | 239 print out |
239 print '}' | 240 print '}' |
240 | 241 |
OLD | NEW |